idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
700
public Type externalType ( Types types ) { Type t = erasure ( types ) ; if ( name == name . table . names . init && owner . hasOuterInstance ( ) ) { Type outerThisType = types . erasure ( owner . type . getEnclosingType ( ) ) ; return new MethodType ( t . getParameterTypes ( ) . prepend ( outerThisType ) , t . getRetur...
The external type of a symbol . This is the symbol s erased type except for constructors of inner classes which get the enclosing instance class added as first argument .
701
public ClassSymbol outermostClass ( ) { Symbol sym = this ; Symbol prev = null ; while ( sym . kind != PCK ) { prev = sym ; sym = sym . owner ; } return ( ClassSymbol ) prev ; }
The outermost class which indirectly owns this symbol .
702
public PackageSymbol packge ( ) { Symbol sym = this ; while ( sym . kind != PCK ) { sym = sym . owner ; } return ( PackageSymbol ) sym ; }
The package which indirectly owns this symbol .
703
public boolean isEnclosedBy ( ClassSymbol clazz ) { for ( Symbol sym = this ; sym . kind != PCK ; sym = sym . owner ) if ( sym == clazz ) return true ; return false ; }
Is this symbol the same as or enclosed by the given class?
704
Comment comment ( ) { if ( comment == null ) { String d = documentation ( ) ; if ( env . javaScriptScanner != null ) { env . javaScriptScanner . parse ( d , new JavaScriptScanner . Reporter ( ) { public void report ( ) { env . error ( DocImpl . this , "javadoc.JavaScript_in_comment" ) ; throw new FatalError ( ) ; } } )...
For lazy initialization of comment .
705
String readHTMLDocumentation ( InputStream input , FileObject filename ) throws IOException { byte [ ] filecontents = new byte [ input . available ( ) ] ; try { DataInputStream dataIn = new DataInputStream ( input ) ; dataIn . readFully ( filecontents ) ; } finally { input . close ( ) ; } String encoding = env . getEnc...
Utility for subclasses which read HTML documentation files .
706
void setTreePath ( TreePath treePath ) { this . treePath = treePath ; documentation = getCommentText ( treePath ) ; comment = null ; }
Set the full unprocessed text of the comment and tree path .
707
private void validateTypeNotIn ( TypeMirror t , Set < TypeKind > invalidKinds ) { if ( invalidKinds . contains ( t . getKind ( ) ) ) throw new IllegalArgumentException ( t . toString ( ) ) ; }
Throws an IllegalArgumentException if a type s kind is one of a set .
708
private static < T > T cast ( Class < T > clazz , Object o ) { if ( ! clazz . isInstance ( o ) ) throw new IllegalArgumentException ( o . toString ( ) ) ; return clazz . cast ( o ) ; }
Returns an object cast to the specified type .
709
public final void setBorderWidth ( int unit , int size ) { if ( size < 0 ) { throw new IllegalArgumentException ( "Border width cannot be less than zero." ) ; } int scaledSize = ( int ) TypedValue . applyDimension ( unit , size , getResources ( ) . getDisplayMetrics ( ) ) ; setBorderInternal ( scaledSize , mBorderColor...
Sets the border width .
710
public final void setPlaceholder ( String text ) { if ( ! text . equalsIgnoreCase ( mText ) ) { setPlaceholderTextInternal ( text , mTextColor , mTextSize , true ) ; } }
Sets the placeholder text .
711
public final void setPlaceholderTextSize ( int unit , int size ) { if ( size < 0 ) { throw new IllegalArgumentException ( "Text size cannot be less than zero." ) ; } int scaledSize = ( int ) TypedValue . applyDimension ( unit , size , getResources ( ) . getDisplayMetrics ( ) ) ; setPlaceholderTextInternal ( mText , mTe...
Sets the placeholder text size .
712
public void setShadowRadius ( float radius ) { if ( radius < 0 ) { throw new IllegalArgumentException ( "Shadow radius cannot be less than zero." ) ; } if ( radius != mShadowRadius ) { setShadowInternal ( radius , mShadowColor , true ) ; } }
Sets shadow radius
713
public void allowCheckStateShadow ( boolean allow ) { if ( allow != mAllowCheckStateShadow ) { mAllowCheckStateShadow = allow ; setShadowInternal ( mShadowRadius , mShadowColor , true ) ; } }
Allow shadow when in checked state .
714
protected String formatPlaceholderText ( String text ) { String formattedText = ( null != text ) ? text . trim ( ) : null ; int length = ( null != formattedText ) ? formattedText . length ( ) : 0 ; if ( length > 0 ) { return formattedText . substring ( 0 , Math . min ( 2 , length ) ) . toUpperCase ( Locale . getDefault...
Default implementation of the placeholder text formatting .
715
protected void drawCheckedState ( Canvas canvas , int w , int h ) { int x = w / 2 ; int y = h / 2 ; canvas . drawCircle ( x , y , mRadius - ( mShadowRadius * 1.5f ) , mCheckedBackgroundPaint ) ; canvas . save ( ) ; int shortStrokeHeight = ( int ) ( mLongStrokeHeight * .4f ) ; int halfH = ( int ) ( mLongStrokeHeight * ....
Draws the checked state .
716
private void updateBitmapShader ( ) { Drawable drawable = getDrawable ( ) ; Bitmap bitmap = null ; if ( ( null != drawable ) && ( drawable instanceof BitmapDrawable ) ) { bitmap = ( ( BitmapDrawable ) drawable ) . getBitmap ( ) ; } if ( null == bitmap ) { mBitmapPaint . setShader ( null ) ; return ; } int bitmapWidth =...
Updates BitmapShader to draw the bitmap in CENTER_CROP mode .
717
@ DefinedBy ( Api . COMPILER_TREE ) public TypeMirror getOriginalType ( javax . lang . model . type . ErrorType errorType ) { if ( errorType instanceof com . sun . tools . javac . code . Type . ErrorType ) { return ( ( com . sun . tools . javac . code . Type . ErrorType ) errorType ) . getOriginalType ( ) ; } return co...
Returns the original type from the ErrorType object .
718
@ DefinedBy ( Api . COMPILER_TREE ) public void printMessage ( Diagnostic . Kind kind , CharSequence msg , com . sun . source . tree . Tree t , com . sun . source . tree . CompilationUnitTree root ) { printMessage ( kind , msg , ( ( JCTree ) t ) . pos ( ) , root ) ; }
Prints a message of the specified kind at the location of the tree within the provided compilation unit
719
void setResult ( JCExpression tree , Type type ) { result = type ; if ( env . info . isSpeculative ) { tree . type = result ; } }
Set the results of method attribution .
720
Type attribArg ( JCTree tree , Env < AttrContext > env ) { Env < AttrContext > prevEnv = this . env ; try { this . env = env ; tree . accept ( this ) ; return result ; } finally { this . env = prevEnv ; } }
Main entry point for attributing an argument with given tree and attribution environment .
721
@ SuppressWarnings ( "unchecked" ) < T extends JCExpression , Z extends ArgumentType < T > > void processArg ( T that , Function < T , Z > argumentTypeFactory ) { UniquePos pos = new UniquePos ( that ) ; processArg ( that , ( ) -> { T speculativeTree = ( T ) deferredAttr . attribSpeculative ( that , env , attr . new Me...
Process a method argument ; this method takes care of performing a speculative pass over the argument tree and calling a well - defined entry point to build the argument type associated with such tree .
722
public Stream < ModuleDescriptor > descriptors ( ) { return automaticToNormalModule . entrySet ( ) . stream ( ) . map ( Map . Entry :: getValue ) . map ( Module :: descriptor ) ; }
Returns the stream of resulting ModuleDescriptors
723
private Map < Archive , Set < Archive > > computeRequiresTransitive ( ) throws IOException { dependencyFinder . parseExportedAPIs ( automaticModules ( ) . stream ( ) ) ; return dependencyFinder . dependences ( ) ; }
Compute requires transitive dependences by analyzing API dependencies
724
String indent ( String s , int level ) { return Stream . of ( s . split ( "\n" ) ) . map ( sub -> INDENT_STRING . substring ( 0 , level * INDENT_WIDTH ) + sub ) . collect ( Collectors . joining ( "\n" ) ) ; }
Indent a string to a given level .
725
String packageName ( File file ) { String path = file . getAbsolutePath ( ) ; int begin = path . lastIndexOf ( File . separatorChar + "com" + File . separatorChar ) ; String packagePath = path . substring ( begin + 1 , path . lastIndexOf ( File . separatorChar ) ) ; String packageName = packagePath . replace ( File . s...
Retrieve package part of given file object .
726
public static String toplevelName ( File file ) { return Stream . of ( file . getName ( ) . split ( "\\." ) ) . map ( s -> Character . toUpperCase ( s . charAt ( 0 ) ) + s . substring ( 1 ) ) . collect ( Collectors . joining ( "" ) ) ; }
Form the name of the toplevel factory class .
727
List < String > generateImports ( Set < String > importedTypes ) { List < String > importDecls = new ArrayList < > ( ) ; for ( String it : importedTypes ) { importDecls . add ( StubKind . IMPORT . format ( it ) ) ; } return importDecls ; }
Generate a list of import declarations given a set of imported types .
728
List < String > argDecls ( List < String > types , List < String > args ) { List < String > argNames = new ArrayList < > ( ) ; for ( int i = 0 ; i < types . size ( ) ; i ++ ) { argNames . add ( types . get ( i ) + " " + args . get ( i ) ) ; } return argNames ; }
Generate a formal parameter list given a list of types and names .
729
List < String > argNames ( int size ) { List < String > argNames = new ArrayList < > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { argNames . add ( StubKind . FACTORY_METHOD_ARG . format ( i ) ) ; } return argNames ; }
Generate a list of formal parameter names given a size .
730
boolean needsSuppressWarnings ( List < MessageType > msgTypes ) { return msgTypes . stream ( ) . anyMatch ( t -> t . accept ( suppressWarningsVisitor , null ) ) ; }
See if any of the parsed types in the given list needs warning suppression .
731
Set < String > importedTypes ( List < MessageType > msgTypes ) { Set < String > imports = new TreeSet < > ( ) ; msgTypes . forEach ( t -> t . accept ( importVisitor , imports ) ) ; return imports ; }
Retrieve a list of types that need to be imported so that the factory body can refer to the types in the given list using simple names .
732
List < List < MessageType > > normalizeTypes ( int idx , List < MessageType > msgTypes ) { if ( msgTypes . size ( ) == idx ) return Collections . singletonList ( Collections . emptyList ( ) ) ; MessageType head = msgTypes . get ( idx ) ; List < List < MessageType > > buf = new ArrayList < > ( ) ; for ( MessageType alte...
Normalize parsed types in a comment line . If one or more types in the line contains alternatives this routine generate a list of overloaded normalized signatures .
733
public ClassDocImpl lookupClass ( String name ) { ClassSymbol c = getClassSymbol ( name ) ; if ( c != null ) { return getClassDoc ( c ) ; } else { return null ; } }
Look up ClassDoc by qualified name .
734
public void setLocale ( String localeName ) { doclocale = new DocLocale ( this , localeName , breakiterator ) ; messager . setLocale ( doclocale . locale ) ; }
Set the locale .
735
public boolean shouldDocument ( VarSymbol sym ) { long mod = sym . flags ( ) ; if ( ( mod & Flags . SYNTHETIC ) != 0 ) { return false ; } return showAccess . checkModifier ( translateModifiers ( mod ) ) ; }
Check whether this member should be documented .
736
public boolean shouldDocument ( ClassSymbol sym ) { return ( sym . flags_field & Flags . SYNTHETIC ) == 0 && ( docClasses || getClassDoc ( sym ) . tree != null ) && isVisible ( sym ) ; }
check whether this class should be documented .
737
public PackageDocImpl getPackageDoc ( PackageSymbol pack ) { PackageDocImpl result = packageMap . get ( pack ) ; if ( result != null ) return result ; result = new PackageDocImpl ( this , pack ) ; packageMap . put ( pack , result ) ; return result ; }
Return the PackageDoc of this package symbol .
738
public FieldDocImpl getFieldDoc ( VarSymbol var ) { FieldDocImpl result = fieldMap . get ( var ) ; if ( result != null ) return result ; result = new FieldDocImpl ( this , var ) ; fieldMap . put ( var , result ) ; return result ; }
Return the FieldDoc of this var symbol .
739
protected void makeFieldDoc ( VarSymbol var , TreePath treePath ) { FieldDocImpl result = fieldMap . get ( var ) ; if ( result != null ) { if ( treePath != null ) result . setTreePath ( treePath ) ; } else { result = new FieldDocImpl ( this , var , treePath ) ; fieldMap . put ( var , result ) ; } }
Create a FieldDoc for a var symbol .
740
protected void makeMethodDoc ( MethodSymbol meth , TreePath treePath ) { MethodDocImpl result = ( MethodDocImpl ) methodMap . get ( meth ) ; if ( result != null ) { if ( treePath != null ) result . setTreePath ( treePath ) ; } else { result = new MethodDocImpl ( this , meth , treePath ) ; methodMap . put ( meth , resul...
Create a MethodDoc for this MethodSymbol . Should be called only on symbols representing methods .
741
public MethodDocImpl getMethodDoc ( MethodSymbol meth ) { assert ! meth . isConstructor ( ) : "not expecting a constructor symbol" ; MethodDocImpl result = ( MethodDocImpl ) methodMap . get ( meth ) ; if ( result != null ) return result ; result = new MethodDocImpl ( this , meth ) ; methodMap . put ( meth , result ) ; ...
Return the MethodDoc for a MethodSymbol . Should be called only on symbols representing methods .
742
protected void makeConstructorDoc ( MethodSymbol meth , TreePath treePath ) { ConstructorDocImpl result = ( ConstructorDocImpl ) methodMap . get ( meth ) ; if ( result != null ) { if ( treePath != null ) result . setTreePath ( treePath ) ; } else { result = new ConstructorDocImpl ( this , meth , treePath ) ; methodMap ...
Create the ConstructorDoc for a MethodSymbol . Should be called only on symbols representing constructors .
743
public ConstructorDocImpl getConstructorDoc ( MethodSymbol meth ) { assert meth . isConstructor ( ) : "expecting a constructor symbol" ; ConstructorDocImpl result = ( ConstructorDocImpl ) methodMap . get ( meth ) ; if ( result != null ) return result ; result = new ConstructorDocImpl ( this , meth ) ; methodMap . put (...
Return the ConstructorDoc for a MethodSymbol . Should be called only on symbols representing constructors .
744
protected void makeAnnotationTypeElementDoc ( MethodSymbol meth , TreePath treePath ) { AnnotationTypeElementDocImpl result = ( AnnotationTypeElementDocImpl ) methodMap . get ( meth ) ; if ( result != null ) { if ( treePath != null ) result . setTreePath ( treePath ) ; } else { result = new AnnotationTypeElementDocImpl...
Create the AnnotationTypeElementDoc for a MethodSymbol . Should be called only on symbols representing annotation type elements .
745
public AnnotationTypeElementDocImpl getAnnotationTypeElementDoc ( MethodSymbol meth ) { AnnotationTypeElementDocImpl result = ( AnnotationTypeElementDocImpl ) methodMap . get ( meth ) ; if ( result != null ) return result ; result = new AnnotationTypeElementDocImpl ( this , meth ) ; methodMap . put ( meth , result ) ; ...
Return the AnnotationTypeElementDoc for a MethodSymbol . Should be called only on symbols representing annotation type elements .
746
static int translateModifiers ( long flags ) { int result = 0 ; if ( ( flags & Flags . ABSTRACT ) != 0 ) result |= Modifier . ABSTRACT ; if ( ( flags & Flags . FINAL ) != 0 ) result |= Modifier . FINAL ; if ( ( flags & Flags . INTERFACE ) != 0 ) result |= Modifier . INTERFACE ; if ( ( flags & Flags . NATIVE ) != 0 ) re...
Convert modifier bits from private coding used by the compiler to that of java . lang . reflect . Modifier .
747
void analyzeIfNeeded ( JCTree tree , Env < AttrContext > env ) { if ( ! analyzerModes . isEmpty ( ) && ! env . info . isSpeculative && TreeInfo . isStatement ( tree ) ) { JCStatement stmt = ( JCStatement ) tree ; analyze ( stmt , env ) ; } }
Analyze an AST node if needed .
748
void analyze ( JCStatement statement , Env < AttrContext > env ) { AnalysisContext context = new AnalysisContext ( ) ; StatementScanner statementScanner = new StatementScanner ( context ) ; statementScanner . scan ( statement ) ; if ( ! context . treesToAnalyzer . isEmpty ( ) ) { JCBlock fakeBlock = make . Block ( SYNT...
Analyze an AST node ; this involves collecting a list of all the nodes that needs rewriting and speculatively type - check the rewritten code to compare results against previously attributed code .
749
public boolean isOrdinaryClass ( ) { if ( isEnum ( ) || isInterface ( ) || isAnnotationType ( ) ) { return false ; } for ( Type t = type ; t . hasTag ( CLASS ) ; t = env . types . supertype ( t ) ) { if ( t . tsym == env . syms . errorType . tsym || t . tsym == env . syms . exceptionType . tsym ) { return false ; } } r...
Return true if this is a ordinary class not an enumeration exception an error or an interface .
750
public boolean isThrowable ( ) { if ( isEnum ( ) || isInterface ( ) || isAnnotationType ( ) ) { return false ; } for ( Type t = type ; t . hasTag ( CLASS ) ; t = env . types . supertype ( t ) ) { if ( t . tsym == env . syms . throwableType . tsym ) { return true ; } } return false ; }
Return true if this is a throwable class
751
public boolean isIncluded ( ) { if ( isIncluded ) { return true ; } if ( env . shouldDocument ( tsym ) ) { if ( containingPackage ( ) . isIncluded ( ) ) { return isIncluded = true ; } ClassDoc outer = containingClass ( ) ; if ( outer != null && outer . isIncluded ( ) ) { return isIncluded = true ; } } return false ; }
Return true if this class is included in the active set . A ClassDoc is included iff either it is specified on the commandline or if it s containing package is specified on the command line or if it is a member class of an included class .
752
public PackageDoc containingPackage ( ) { PackageDocImpl p = env . getPackageDoc ( tsym . packge ( ) ) ; if ( p . setDocPath == false ) { FileObject docPath ; try { Location location = env . fileManager . hasLocation ( StandardLocation . SOURCE_PATH ) ? StandardLocation . SOURCE_PATH : StandardLocation . CLASS_PATH ; d...
Return the package that this class is contained in .
753
public ClassDoc superclass ( ) { if ( isInterface ( ) || isAnnotationType ( ) ) return null ; if ( tsym == env . syms . objectType . tsym ) return null ; ClassSymbol c = ( ClassSymbol ) env . types . supertype ( type ) . tsym ; if ( c == null || c == tsym ) c = ( ClassSymbol ) env . syms . objectType . tsym ; return en...
Return the superclass of this class
754
public boolean subclassOf ( ClassDoc cd ) { return tsym . isSubClass ( ( ( ClassDocImpl ) cd ) . tsym , env . types ) ; }
Test whether this class is a subclass of the specified class .
755
public ClassDoc [ ] interfaces ( ) { ListBuffer < ClassDocImpl > ta = new ListBuffer < > ( ) ; for ( Type t : env . types . interfaces ( type ) ) { ta . append ( env . getClassDoc ( ( ClassSymbol ) t . tsym ) ) ; } return ta . toArray ( new ClassDocImpl [ ta . length ( ) ] ) ; }
Return interfaces implemented by this class or interfaces extended by this interface .
756
public com . sun . javadoc . Type [ ] interfaceTypes ( ) { return TypeMaker . getTypes ( env , env . types . interfaces ( type ) ) ; }
Return interfaces implemented by this class or interfaces extended by this interface . Includes only directly - declared interfaces not inherited interfaces . Return an empty array if there are no interfaces .
757
public ClassDoc [ ] importedClasses ( ) { if ( tsym . sourcefile == null ) return new ClassDoc [ 0 ] ; ListBuffer < ClassDocImpl > importedClasses = new ListBuffer < > ( ) ; Env < AttrContext > compenv = env . enter . getEnv ( tsym ) ; if ( compenv == null ) return new ClassDocImpl [ 0 ] ; Name asterisk = tsym . name ....
Get the list of classes declared as imported . These are called single - type - import declarations in the JLS . This method is deprecated in the ClassDoc interface .
758
public PackageDoc [ ] importedPackages ( ) { if ( tsym . sourcefile == null ) return new PackageDoc [ 0 ] ; ListBuffer < PackageDocImpl > importedPackages = new ListBuffer < > ( ) ; Names names = tsym . name . table . names ; importedPackages . append ( env . getPackageDoc ( env . syms . enterPackage ( env . syms . jav...
Get the list of packages declared as imported . These are called type - import - on - demand declarations in the JLS . This method is deprecated in the ClassDoc interface .
759
public MethodDoc [ ] serializationMethods ( ) { if ( serializedForm == null ) { serializedForm = new SerializedForm ( env , tsym , this ) ; } return serializedForm . methods ( ) ; }
Return the serialization methods for this class .
760
protected void addModulesToIndexMap ( ) { for ( ModuleElement mdle : configuration . modules ) { String mdleName = mdle . getQualifiedName ( ) . toString ( ) ; char ch = ( mdleName . length ( ) == 0 ) ? '*' : Character . toUpperCase ( mdleName . charAt ( 0 ) ) ; Character unicode = ch ; SortedSet < Element > list = ind...
Add all the modules to index map .
761
protected boolean shouldAddToIndexMap ( Element element ) { if ( utils . isHidden ( element ) ) { return false ; } if ( utils . isPackage ( element ) ) return ! ( noDeprecated && configuration . utils . isDeprecated ( element ) ) ; else return ! ( noDeprecated && ( configuration . utils . isDeprecated ( element ) || co...
Should this element be added to the index map?
762
public List < ? extends Element > getMemberList ( Character index ) { SortedSet < Element > set = indexmap . get ( index ) ; if ( set == null ) return null ; List < Element > out = new ArrayList < > ( ) ; out . addAll ( set ) ; return out ; }
Return the sorted list of members for passed Unicode Character .
763
protected void buildAllClassesFile ( boolean wantFrames ) throws IOException { String label = configuration . getText ( "doclet.All_Classes" ) ; Content body = getBody ( false , getWindowTitle ( label ) ) ; Content heading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , HtmlStyle . bar , allclassesLabel ) ; body...
Print all the classes in the file .
764
public static Messager instance0 ( Context context ) { Log instance = context . get ( logKey ) ; if ( instance == null || ! ( instance instanceof Messager ) ) throw new InternalError ( "no messager instance!" ) ; return ( Messager ) instance ; }
Get the current messager which is also the compiler log .
765
String getText ( String key , Object ... args ) { return messages . getLocalizedString ( locale , key , args ) ; }
get and format message string from resource
766
public void printWarning ( SourcePosition pos , String msg ) { if ( diagListener != null ) { report ( DiagnosticType . WARNING , pos , msg ) ; return ; } if ( nwarnings < MaxWarnings ) { String prefix = ( pos == null ) ? programName : pos . toString ( ) ; PrintWriter warnWriter = getWriter ( WriterKind . WARNING ) ; wa...
Print warning message increment warning count . Part of DocErrorReporter .
767
public int get ( Object o ) { Integer n = indices . get ( o ) ; return n == null ? - 1 : n . intValue ( ) ; }
Return the given object s index in the pool or - 1 if object is not in there .
768
private static < T > T getSystemTool ( Class < T > clazz , String moduleName , String className ) { if ( useLegacy ) { try { return Class . forName ( className , true , ClassLoader . getSystemClassLoader ( ) ) . asSubclass ( clazz ) . getConstructor ( ) . newInstance ( ) ; } catch ( ReflectiveOperationException e ) { t...
Get an instance of a system tool using the service loader .
769
private static < T > boolean matches ( T tool , String moduleName ) { PrivilegedAction < Boolean > pa = ( ) -> { try { Method getModuleMethod = Class . class . getDeclaredMethod ( "getModule" ) ; Object toolModule = getModuleMethod . invoke ( tool . getClass ( ) ) ; Method getNameMethod = toolModule . getClass ( ) . ge...
Determine if this is the desired tool instance .
770
public static ModuleSummaryBuilder getInstance ( Context context , ModuleElement mdle , ModuleSummaryWriter moduleWriter ) { return new ModuleSummaryBuilder ( context , mdle , moduleWriter ) ; }
Construct a new ModuleSummaryBuilder .
771
public void buildModuleDoc ( XMLNode node , Content contentTree ) throws DocletException { contentTree = moduleWriter . getModuleHeader ( mdle . getQualifiedName ( ) . toString ( ) ) ; buildChildren ( node , contentTree ) ; moduleWriter . addModuleFooter ( contentTree ) ; moduleWriter . printDocument ( contentTree ) ; ...
Build the module documentation .
772
public void buildContent ( XMLNode node , Content contentTree ) throws DocletException { Content moduleContentTree = moduleWriter . getContentHeader ( ) ; buildChildren ( node , moduleContentTree ) ; moduleWriter . addModuleContent ( contentTree , moduleContentTree ) ; }
Build the content for the module doc .
773
public void buildSummary ( XMLNode node , Content moduleContentTree ) throws DocletException { Content summaryContentTree = moduleWriter . getSummaryHeader ( ) ; buildChildren ( node , summaryContentTree ) ; moduleContentTree . addContent ( moduleWriter . getSummaryTree ( summaryContentTree ) ) ; }
Build the module summary .
774
public void buildModuleDescription ( XMLNode node , Content moduleContentTree ) { if ( ! configuration . nocomment ) { moduleWriter . addModuleDescription ( moduleContentTree ) ; } }
Build the description for the module .
775
public void buildClassContent ( XMLNode node , Content classTree ) throws DocletException { Content classContentTree = writer . getClassContentHeader ( ) ; buildChildren ( node , classContentTree ) ; classTree . addContent ( classContentTree ) ; }
Build the summaries for the methods and fields .
776
public void buildMethodSubHeader ( XMLNode node , Content methodsContentTree ) { methodWriter . addMemberHeader ( ( ExecutableElement ) currentMember , methodsContentTree ) ; }
Build the method sub header .
777
public void buildDeprecatedMethodInfo ( XMLNode node , Content methodsContentTree ) { methodWriter . addDeprecatedMemberInfo ( ( ExecutableElement ) currentMember , methodsContentTree ) ; }
Build the deprecated method description .
778
public void buildMethodInfo ( XMLNode node , Content methodsContentTree ) throws DocletException { if ( configuration . nocomment ) { return ; } buildChildren ( node , methodsContentTree ) ; }
Build the information for the method .
779
public static boolean serialInclude ( Utils utils , Element element ) { if ( element == null ) { return false ; } return utils . isClass ( element ) ? serialClassInclude ( utils , ( TypeElement ) element ) : serialDocInclude ( utils , element ) ; }
Returns true if the given Element should be included in the serialized form .
780
private static boolean serialClassInclude ( Utils utils , TypeElement te ) { if ( utils . isEnum ( te ) ) { return false ; } if ( utils . isSerializable ( te ) ) { if ( ! utils . getSerialTrees ( te ) . isEmpty ( ) ) { return serialDocInclude ( utils , te ) ; } else if ( utils . isPublic ( te ) || utils . isProtected (...
Returns true if the given TypeElement should be included in the serialized form .
781
private static boolean serialDocInclude ( Utils utils , Element element ) { if ( utils . isEnum ( element ) ) { return false ; } List < ? extends DocTree > serial = utils . getSerialTrees ( element ) ; if ( ! serial . isEmpty ( ) ) { CommentHelper ch = utils . getCommentHelper ( element ) ; String serialtext = Utils . ...
Return true if the given Element should be included in the serialized form .
782
public Set < Deque < Archive > > inverseDependences ( ) throws IOException { DependencyFinder dependencyFinder = new DependencyFinder ( configuration , DEFAULT_FILTER ) ; try { Stream < Archive > archives = Stream . concat ( configuration . initialArchives ( ) . stream ( ) , configuration . classPathArchives ( ) . stre...
Finds all inverse transitive dependencies using the given requires set as the targets if non - empty . If the given requires set is empty use the archives depending the packages specified in - regex or - p options .
783
private Set < Deque < Archive > > findPaths ( Graph < Archive > graph , Archive target ) { Deque < Archive > path = new LinkedList < > ( ) ; path . push ( target ) ; Set < Edge < Archive > > visited = new HashSet < > ( ) ; Deque < Edge < Archive > > deque = new LinkedList < > ( ) ; deque . addAll ( graph . edgesFrom ( ...
Returns all paths reachable from the given targets .
784
private Stream < Deque < Archive > > makePaths ( Deque < Archive > path ) { Set < Archive > nodes = endPoints . get ( path . peekFirst ( ) ) ; if ( nodes == null || nodes . isEmpty ( ) ) { return Stream . of ( new LinkedList < > ( path ) ) ; } else { return nodes . stream ( ) . map ( n -> { Deque < Archive > newPath = ...
Prepend end point to the path
785
public void run ( String ... args ) throws BadArgs , IOException { PrintWriter out = new PrintWriter ( System . out ) ; try { run ( out , args ) ; } finally { out . flush ( ) ; } }
Simple API entry point .
786
protected Content getNavLinkClassUse ( ) { Content useLink = getHyperLink ( DocPaths . PACKAGE_USE , contents . useLabel , "" , "" ) ; Content li = HtmlTree . LI ( useLink ) ; return li ; }
Get Use link for this pacakge in the navigation bar .
787
protected Content getNavLinkPackage ( ) { Content li = HtmlTree . LI ( HtmlStyle . navBarCell1Rev , contents . packageLabel ) ; return li ; }
Highlight Package in the navigation bar as this is the package page .
788
public void hard ( String format , Object ... args ) { rawout ( prefix ( format ) , args ) ; }
Must show command output
789
String getResourceString ( String key ) { if ( outputRB == null ) { try { outputRB = ResourceBundle . getBundle ( L10N_RB_NAME , locale ) ; } catch ( MissingResourceException mre ) { error ( "Cannot find ResourceBundle: %s for locale: %s" , L10N_RB_NAME , locale ) ; return "" ; } } String s ; try { s = outputRB . getSt...
Resource bundle look - up
790
public void hardmsg ( String key , Object ... args ) { hard ( messageFormat ( key , args ) ) ; }
Print using resource bundle look - up MessageFormat and add prefix and postfix
791
public void errormsg ( String key , Object ... args ) { if ( isRunningInteractive ( ) ) { rawout ( prefixError ( messageFormat ( key , args ) ) ) ; } else { startmsg ( key , args ) ; } }
Print error using resource bundle look - up MessageFormat and add prefix and postfix
792
void startmsg ( String key , Object ... args ) { cmderr . println ( messageFormat ( key , args ) ) ; }
Print command - line error using resource bundle look - up MessageFormat
793
public void start ( String [ ] args ) throws Exception { OptionParserCommandLine commandLineArgs = new OptionParserCommandLine ( ) ; options = commandLineArgs . parse ( args ) ; if ( options == null ) { return ; } startup = commandLineArgs . startup ( ) ; configEditor ( ) ; try { resetState ( ) ; } catch ( IllegalState...
The entry point into the JShell tool .
794
private CompletionProvider snippetCompletion ( Supplier < Stream < ? extends Snippet > > snippetsSupplier ) { return ( prefix , cursor , anchor ) -> { anchor [ 0 ] = 0 ; int space = prefix . lastIndexOf ( ' ' ) ; Set < String > prior = new HashSet < > ( Arrays . asList ( prefix . split ( " " ) ) ) ; if ( prior . contai...
Completion based on snippet supplier
795
private CompletionProvider helpCompletion ( ) { return ( code , cursor , anchor ) -> { List < Suggestion > result ; int pastSpace = code . indexOf ( ' ' ) + 1 ; if ( pastSpace == 0 ) { boolean noslash = code . length ( ) > 0 && ! code . startsWith ( "/" ) ; result = new FixedCompletionProvider ( commands . values ( ) ....
Completion of help commands and subjects
796
String subCommand ( String cmd , ArgTokenizer at , String [ ] subs ) { at . allowedOptions ( "-retain" ) ; String sub = at . next ( ) ; if ( sub == null ) { return at . hasOption ( "-retain" ) ? "_retain" : "_blank" ; } String [ ] matches = Arrays . stream ( subs ) . filter ( s -> s . startsWith ( sub ) ) . toArray ( S...
Return null on error
797
private static < T extends Snippet > Stream < T > nonEmptyStream ( Supplier < Stream < T > > supplier , SnippetPredicate < T > ... filters ) { for ( SnippetPredicate < T > filt : filters ) { Iterator < T > iterator = supplier . get ( ) . filter ( filt ) . iterator ( ) ; if ( iterator . hasNext ( ) ) { return StreamSupp...
Apply filters to a stream until one that is non - empty is found . Adapted from Stuart Marks
798
private < T extends Snippet > Stream < T > argsToSnippets ( Supplier < Stream < T > > snippetSupplier , List < String > args ) { Stream < T > result = null ; for ( String arg : args ) { Stream < T > st = layeredSnippetSearch ( snippetSupplier , arg ) ; if ( st == null ) { Stream < Snippet > est = layeredSnippetSearch (...
Convert user arguments to a Stream of snippets referenced by those arguments .
799
private boolean builtInEdit ( String initialText , Consumer < String > saveHandler , Consumer < String > errorHandler ) { try { ServiceLoader < BuildInEditorProvider > sl = ServiceLoader . load ( BuildInEditorProvider . class ) ; BuildInEditorProvider provider = null ; for ( BuildInEditorProvider p : sl ) { if ( provid...
start the built - in editor