idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
7,600 | public static Backbone computeNegative ( final Formula formula , final Collection < Variable > variables ) { return compute ( formula , variables , BackboneType . ONLY_NEGATIVE ) ; } | Computes the negative backbone variables for a given formula w . r . t . a collection of variables . |
7,601 | public static Backbone computeNegative ( final Formula formula ) { return compute ( formula , formula . variables ( ) , BackboneType . ONLY_NEGATIVE ) ; } | Computes the negative backbone variables for a given formula . |
7,602 | public void push ( final T element ) { int newSize = this . size + 1 ; this . ensure ( newSize ) ; this . elements [ this . size ++ ] = element ; } | Pushes an element at the end of the vector . |
7,603 | public void shrinkTo ( int newSize ) { if ( newSize < this . size ) { for ( int i = this . size ; i > newSize ; i -- ) this . elements [ i - 1 ] = null ; this . size = newSize ; } } | Shrinks the vector to a given size if the new size is less then the current size . Otherwise the size remains the same . |
7,604 | @ SuppressWarnings ( "unchecked" ) public void replaceInplace ( final LNGVector < ? extends T > other ) { if ( this == other ) throw new IllegalArgumentException ( "cannot replace a vector in-place with itself" ) ; this . elements = ( T [ ] ) new Object [ other . size ( ) ] ; for ( int i = 0 ; i < other . size ( ) ; i ... | Replaces the contents of this vector with the contents of another vector in - place . |
7,605 | private void selectionSort ( final T [ ] array , int start , int end , Comparator < T > lt ) { int i ; int j ; int bestI ; T tmp ; for ( i = start ; i < end ; i ++ ) { bestI = i ; for ( j = i + 1 ; j < end ; j ++ ) { if ( lt . compare ( array [ j ] , array [ bestI ] ) < 0 ) bestI = j ; } tmp = array [ i ] ; array [ i ]... | Selection sort implementation for a given array . |
7,606 | private void sort ( final T [ ] array , int start , int end , Comparator < T > lt ) { if ( start == end ) return ; if ( ( end - start ) <= 15 ) this . selectionSort ( array , start , end , lt ) ; else { final T pivot = array [ start + ( ( end - start ) / 2 ) ] ; T tmp ; int i = start - 1 ; int j = end ; while ( true ) ... | Merge sort implementation for a given array . |
7,607 | public void growTo ( int size , boolean pad ) { if ( this . size >= size ) return ; this . ensure ( size ) ; for ( int i = this . size ; i < size ; i ++ ) this . elements [ i ] = pad ; this . size = size ; } | Grows the vector to a new size and initializes the new elements with a given value . |
7,608 | public void reverseInplace ( ) { for ( int i = 0 ; i < this . size / 2 ; i ++ ) { boolean temp = this . elements [ i ] ; this . elements [ i ] = this . elements [ this . size - i - 1 ] ; this . elements [ this . size ( ) - i - 1 ] = temp ; } } | Reverses the content of this vector in - place . |
7,609 | public EmbeddedMongoDB withVersion ( Version . Main version ) { Objects . requireNonNull ( version , "version can not be null" ) ; this . version = version ; return this ; } | Sets the version for the EmbeddedMongoDB instance |
7,610 | public EmbeddedMongoDB start ( ) { if ( ! this . active ) { try { this . mongodProcess = MongodStarter . getDefaultInstance ( ) . prepare ( new MongodConfigBuilder ( ) . version ( this . version ) . net ( new Net ( this . host , this . port , false ) ) . build ( ) ) . start ( ) ; this . active = true ; LOG . info ( "Su... | Starts the EmbeddedMongoDB instance |
7,611 | public void stop ( ) { if ( this . active ) { this . mongodProcess . stop ( ) ; this . active = false ; LOG . info ( "Successfully stopped EmbeddedMongoDB @ {}:{}" , this . host , this . port ) ; } } | Stops the EmbeddedMongoDB instance |
7,612 | public String encrypt ( String toEncrypt ) { byte [ ] encryptedBytes = encryptInternal ( dataEncryptionSecretKeySpec , toEncrypt ) ; return new String ( base64Encoder . encode ( encryptedBytes ) ) ; } | Encrypt and base64 - encode a String . |
7,613 | private byte [ ] encryptInternal ( SecretKeySpec key , String toEncrypt ) { try { Cipher cipher = Cipher . getInstance ( ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; return cipher . doFinal ( toEncrypt . getBytes ( ENCODING ) ) ; } catch ( GeneralSecurityExcep... | Internal Encryption method . |
7,614 | public String decrypt ( String toDecrypt ) { byte [ ] encryptedBytes = base64Decoder . decode ( toDecrypt ) ; return decryptInternal ( dataEncryptionSecretKeySpec , encryptedBytes ) ; } | Decrypt an encrypted and base64 - encoded String |
7,615 | private String decryptInternal ( SecretKeySpec key , byte [ ] encryptedBytes ) { try { Cipher cipher = Cipher . getInstance ( ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER ) ; cipher . init ( Cipher . DECRYPT_MODE , key ) ; byte [ ] decryptedBytes = cipher . doFinal ( encryptedBytes ) ; return new String ( decry... | Internal decryption method . |
7,616 | public void process ( final Exchange exchange ) throws Exception { final Message in = exchange . getIn ( ) ; final String contentType = in . getHeader ( CONTENT_TYPE , "" , String . class ) ; final String body = in . getBody ( String . class ) ; final Set < String > endpoints = new HashSet < > ( ) ; for ( final String ... | Convert the incoming REST request into the correct Fcrepo header fields . |
7,617 | public void process ( final Exchange exchange ) throws Exception { final Message in = exchange . getIn ( ) ; final String eventURIBase = in . getHeader ( AuditHeaders . EVENT_BASE_URI , String . class ) ; final String eventID = in . getHeader ( FCREPO_EVENT_ID , String . class ) ; final Resource eventURI = createResour... | Define how a message should be processed . |
7,618 | private static String serializedGraphForMessage ( final Message message , final Resource subject ) throws IOException { final ByteArrayOutputStream serializedGraph = new ByteArrayOutputStream ( ) ; final Model model = createDefaultModel ( ) ; @ SuppressWarnings ( "unchecked" ) final List < String > eventType = message ... | Convert a Camel message to audit event description . |
7,619 | private static Optional < String > getAuditEventType ( final List < String > eventType , final List < String > resourceType ) { if ( eventType . contains ( EVENT_NAMESPACE + "ResourceCreation" ) || eventType . contains ( AS_NAMESPACE + "Create" ) ) { if ( resourceType . contains ( REPOSITORY + "Binary" ) ) { return of ... | Returns the Audit event type based on fedora event type and properties . |
7,620 | public List < Map < String , Collection < ? > > > programQuery ( final String uri , final InputStream program ) throws LDPathParseException { return singletonList ( ldpath . programQuery ( new URIImpl ( uri ) , new InputStreamReader ( program ) ) ) ; } | Execute an LDPath query |
7,621 | public static ClientConfiguration createClient ( final AuthScope authScope , final Credentials credentials , final List < Endpoint > endpoints , final List < DataProvider > providers ) { final ClientConfiguration client = new ClientConfiguration ( ) ; if ( credentials != null && authScope != null ) { final CredentialsP... | Create a linked data client suitable for use with a Fedora Repository . |
7,622 | public void configure ( ) throws Exception { final Namespaces ns = new Namespaces ( "rdf" , "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ) . add ( "fedora" , REPOSITORY ) ; onException ( Exception . class ) . maximumRedeliveries ( "{{error.maxRedeliveries}}" ) . log ( "Index Routing Error: ${routeId}" ) ; from ( "{{in... | Configure the message route workflow |
7,623 | public JsonPropertyBuilder < T , P > name ( String name ) { return new JsonPropertyBuilder < T , P > ( coderClass , name , null , null ) ; } | Gets a new instance of property builder for the given key name . |
7,624 | public JsonPropertyBuilder < T , P > coder ( JsonModelCoder < P > coder ) { return new JsonPropertyBuilder < T , P > ( coderClass , name , coder , null ) ; } | Gets a new instance of property builder for the given value coder . |
7,625 | public JsonPropertyBuilder < T , P > router ( JsonCoderRouter < P > router ) { return new JsonPropertyBuilder < T , P > ( coderClass , name , null , router ) ; } | Gets a new instance of property builder for the given coder router . |
7,626 | public Object put ( String key , Object value , State state ) { return put ( key , value , Type . from ( state ) ) ; } | put with State . |
7,627 | public void write ( ) throws IOException { { Filer filer = processingEnv . getFiler ( ) ; String generateClassName = jsonModel . getPackageName ( ) + "." + jsonModel . getTarget ( ) + postfix ; JavaFileObject fileObject = filer . createSourceFile ( generateClassName , classElement ) ; Template . writeGen ( fileObject ,... | Generates the source code . |
7,628 | String getElementKeyString ( Element element ) { JsonKey key = element . getAnnotation ( JsonKey . class ) ; JsonModel model = element . getEnclosingElement ( ) . getAnnotation ( JsonModel . class ) ; if ( ! "" . equals ( key . value ( ) ) ) { return key . value ( ) ; } else if ( "" . equals ( key . value ( ) ) && key ... | Get JSON key string . |
7,629 | public T pop ( ) { final int max = stack . size ( ) - 1 ; if ( max < 0 ) { throw new NoSuchElementException ( ) ; } return stack . remove ( max ) ; } | Pops the value from the top of stack and returns it . |
7,630 | public T peek ( ) { final int top = stack . size ( ) - 1 ; if ( top < 0 ) { throw new NoSuchElementException ( ) ; } return stack . get ( top ) ; } | Returns the value currently on the top of the stack . |
7,631 | public static Integer parserInteger ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_LONG ) { return ( int ) parser . getValueLong ( ) ; } else { throw new Ille... | Parses the current token as an integer . |
7,632 | public static Long parserLong ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_LONG ) { return parser . getValueLong ( ) ; } else { throw new IllegalStateExcept... | Parses the current token as a long . |
7,633 | public static Byte parserByte ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_LONG ) { return ( byte ) parser . getValueLong ( ) ; } else { throw new IllegalSt... | Parses the current token as a byte . |
7,634 | public static Short parserShort ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_LONG ) { return ( short ) parser . getValueLong ( ) ; } else { throw new Illega... | Parses the current token as a short . |
7,635 | public static Boolean parserBoolean ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_BOOLEAN ) { return parser . getValueBoolean ( ) ; } else { throw new Illega... | Parses the current token as a boolean . |
7,636 | public static Character parserCharacter ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_STRING ) { String str = parser . getValueString ( ) ; if ( str . length... | Parses the current token as a character . |
7,637 | public static Double parserDouble ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_DOUBLE ) { return parser . getValueDouble ( ) ; } else { throw new IllegalSta... | Parses the current token as a double - precision floating point value . |
7,638 | public static Float parserFloat ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } else if ( eventType == State . VALUE_DOUBLE ) { return ( float ) parser . getValueDouble ( ) ; } else { throw new Il... | Parses the current token as a single - precision floating point value . |
7,639 | public static List < Integer > parserIntegerList ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStateException ( "not started brace!" ) ... | Parses the current token as a list of integers . |
7,640 | public static List < Boolean > parserBooleanList ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStateException ( "not started brace!" ) ... | Parses the current token as a list of booleans . |
7,641 | public static List < Character > parserCharacterList ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStateException ( "not started brace!... | Parses the current token as a list of characters . |
7,642 | public static List < Double > parserDoubleList ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStateException ( "not started brace!" ) ; ... | Parses the current token as a list of double - precision floating point numbers . |
7,643 | public static List < String > parserStringList ( JsonPullParser parser ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStateException ( "not started brace!" ) ; ... | Parses the current token as a list of strings . |
7,644 | public static < T extends Enum < T > > List < T > parserEnumList ( JsonPullParser parser , Class < T > clazz ) throws IOException , JsonFormatException { State eventType = parser . getEventType ( ) ; if ( eventType == State . VALUE_NULL ) { return null ; } if ( eventType != State . START_ARRAY ) { throw new IllegalStat... | Parses the current token as a list of Enums . |
7,645 | public JsonModelBuilder < T > rm ( String ... names ) { for ( String name : names ) { rmSub ( name ) ; } return this ; } | Detaches property builder for the given names . |
7,646 | public static JsonArray fromParser ( JsonPullParser parser ) throws IOException , JsonFormatException { State state = parser . getEventType ( ) ; if ( state == State . VALUE_NULL ) { return null ; } else if ( state != State . START_ARRAY ) { throw new JsonFormatException ( "unexpected token. token=" + state , parser ) ... | Parses the given JSON data as an array . |
7,647 | public static void e ( String msg , Element element ) { messager . printMessage ( Diagnostic . Kind . ERROR , msg , element ) ; } | Logs error message about the given element . |
7,648 | public static void e ( Throwable e ) { messager . printMessage ( Diagnostic . Kind . ERROR , "exception thrown! " + e . getMessage ( ) ) ; } | Logs error message about the given exception . |
7,649 | public static boolean isPrimitiveWrapper ( Element element ) { if ( element == null ) { return false ; } else if ( element . toString ( ) . equals ( Boolean . class . getCanonicalName ( ) ) ) { return true ; } else if ( element . toString ( ) . equals ( Integer . class . getCanonicalName ( ) ) ) { return true ; } else ... | Tests if the given element is a primitive wrapper . |
7,650 | public static boolean isInternalType ( Types typeUtils , TypeMirror type ) { Element element = ( ( TypeElement ) typeUtils . asElement ( type ) ) . getEnclosingElement ( ) ; return element . getKind ( ) != ElementKind . PACKAGE ; } | Test if the given type is an internal type . |
7,651 | public static boolean isPackagePrivate ( Element element ) { if ( isPublic ( element ) ) { return false ; } else if ( isProtected ( element ) ) { return false ; } else if ( isPrivate ( element ) ) { return false ; } return true ; } | Tests if the given element has the package - private visibility . |
7,652 | public static String getElementSetter ( Element element ) { String setterName = null ; if ( isPrimitiveBoolean ( element ) ) { Pattern pattern = Pattern . compile ( "^is[^a-z].*$" ) ; Matcher matcher = pattern . matcher ( element . getSimpleName ( ) . toString ( ) ) ; if ( matcher . matches ( ) ) { setterName = "set" +... | Returns the name of corresponding setter . |
7,653 | public static String getElementGetter ( Element element ) { String getterName1 = "get" + element . getSimpleName ( ) . toString ( ) ; String getterName2 = "is" + element . getSimpleName ( ) . toString ( ) ; String getterName3 = element . getSimpleName ( ) . toString ( ) ; Element getter = null ; for ( Element method : ... | Returns the name of corresponding getter . |
7,654 | public void setInputFile ( final File value ) { if ( value != null && ! value . isAbsolute ( ) ) { throw new IllegalArgumentException ( "path is not absolute: " + value ) ; } this . inputFile = value ; } | Sets the absolute path to the grammar file to pass into JTB for preprocessing . |
7,655 | public void setOutputDirectory ( final File value ) { if ( value != null && ! value . isAbsolute ( ) ) { throw new IllegalArgumentException ( "path is not absolute: " + value ) ; } this . outputDirectory = value ; } | Sets the absolute path to the output directory for the generated grammar file . |
7,656 | public File getOutputFile ( ) { File outputFile = null ; if ( this . outputDirectory != null && this . inputFile != null ) { final String fileName = FileUtils . removeExtension ( this . inputFile . getName ( ) ) + ".jj" ; outputFile = new File ( this . outputDirectory , fileName ) ; } return outputFile ; } | Gets the absolute path to the enhanced grammar file generated by JTB . |
7,657 | public void setNodeDirectory ( final File value ) { if ( value != null && ! value . isAbsolute ( ) ) { throw new IllegalArgumentException ( "path is not absolute: " + value ) ; } this . nodeDirectory = value ; } | Sets the absolute path to the output directory for the syntax tree files . |
7,658 | private File getEffectiveNodeDirectory ( ) { if ( this . nodeDirectory != null ) return this . nodeDirectory ; if ( this . outputDirectory != null ) return new File ( this . outputDirectory , getLastPackageName ( getEffectiveNodePackageName ( ) ) ) ; return null ; } | Gets the absolute path to the output directory for the syntax tree files . |
7,659 | public void setVisitorDirectory ( final File value ) { if ( value != null && ! value . isAbsolute ( ) ) { throw new IllegalArgumentException ( "path is not absolute: " + value ) ; } this . visitorDirectory = value ; } | Sets the absolute path to the output directory for the visitor files . |
7,660 | private File getEffectiveVisitorDirectory ( ) { if ( this . visitorDirectory != null ) return this . visitorDirectory ; if ( this . outputDirectory != null ) return new File ( this . outputDirectory , getLastPackageName ( getEffectiveVisitorPackageName ( ) ) ) ; return null ; } | Gets the absolute path to the output directory for the visitor files . |
7,661 | private String getEffectiveNodePackageName ( ) { if ( this . packageName != null ) return this . packageName . length ( ) <= 0 ? SYNTAX_TREE : this . packageName + '.' + SYNTAX_TREE ; if ( this . nodePackageName != null ) return this . nodePackageName ; return SYNTAX_TREE ; } | Gets the effective package name for the syntax tree files . |
7,662 | private String getEffectiveVisitorPackageName ( ) { if ( this . packageName != null ) return this . packageName . length ( ) <= 0 ? VISITOR : this . packageName + '.' + VISITOR ; if ( this . visitorPackageName != null ) return this . visitorPackageName ; return VISITOR ; } | Gets the effective package name for the visitor files . |
7,663 | private String [ ] generateArguments ( ) { final List < String > argsList = new ArrayList < > ( ) ; argsList . add ( "-np" ) ; argsList . add ( getEffectiveNodePackageName ( ) ) ; argsList . add ( "-vp" ) ; argsList . add ( getEffectiveVisitorPackageName ( ) ) ; if ( this . supressErrorChecking != null && this . supres... | Assembles the command line arguments for the invocation of JTB according to the configuration . |
7,664 | private String getLastPackageName ( final String name ) { if ( name != null ) { return name . substring ( name . lastIndexOf ( '.' ) + 1 ) ; } return null ; } | Gets the last identifier from the specified package name . For example returns apache upon input of org . apache . JTB uses this approach to derive the output directories for the visitor and syntax tree files . |
7,665 | protected JJTree newJJTree ( ) { final JJTree jjtree = new JJTree ( ) ; jjtree . setLog ( getLog ( ) ) ; jjtree . setGrammarEncoding ( getGrammarEncoding ( ) ) ; jjtree . setOutputEncoding ( getOutputEncoding ( ) ) ; jjtree . setJdkVersion ( getJdkVersion ( ) ) ; jjtree . setBuildNodeFiles ( this . buildNodeFiles ) ; j... | Creates a new facade to invoke JJTree . Most options for the invocation are derived from the current values of the corresponding mojo parameters . The caller is responsible to set the input file output directory and package on the returned facade . |
7,666 | public final void addClassPathEntry ( final File path ) { if ( path != null ) m_aClassPathEntries . add ( path . getAbsolutePath ( ) ) ; } | Adds the specified path to the class path of the forked JVM . |
7,667 | private static File _getResourceSource ( final String resource , final ClassLoader loader ) { if ( resource != null ) { URL url ; if ( loader != null ) { url = loader . getResource ( resource ) ; } else { url = ClassLoader . getSystemResource ( resource ) ; } return UrlUtils . getResourceRoot ( url , resource ) ; } ret... | Gets the JAR file or directory that contains the specified resource . |
7,668 | private Commandline _createCommandLine ( ) { final Commandline cli = new Commandline ( ) ; cli . setExecutable ( this . executable ) ; if ( this . workingDirectory != null ) { cli . setWorkingDirectory ( this . workingDirectory . getAbsolutePath ( ) ) ; } final String classPath = _getClassPath ( ) ; if ( classPath != n... | Creates the command line for the new JVM based on the current configuration . |
7,669 | private File [ ] getSourceDirectories ( ) { final Set < File > directories = new LinkedHashSet < > ( ) ; if ( this . sourceDirectories != null && this . sourceDirectories . length > 0 ) { directories . addAll ( Arrays . asList ( this . sourceDirectories ) ) ; } else { if ( this . defaultGrammarDirectoryJavaCC != null )... | Get the source directories that should be scanned for grammar files . |
7,670 | public void executeReport ( final Locale locale ) throws MavenReportException { final Sink sink = getSink ( ) ; createReportHeader ( getBundle ( locale ) , sink ) ; final File [ ] sourceDirs = getSourceDirectories ( ) ; for ( final File sourceDir : sourceDirs ) { final GrammarInfo [ ] grammarInfos = scanForGrammars ( s... | Run the actual report . |
7,671 | private void createReportHeader ( final ResourceBundle bundle , final Sink sink ) { sink . head ( ) ; sink . title ( ) ; sink . text ( bundle . getString ( "report.jjdoc.title" ) ) ; sink . title_ ( ) ; sink . head_ ( ) ; sink . body ( ) ; sink . section1 ( ) ; sink . sectionTitle1 ( ) ; sink . text ( bundle . getStrin... | Create the header and title for the HTML report page . |
7,672 | private void createReportLink ( final Sink sink , final File sourceDirectory , final File grammarFile , String linkPath ) { sink . tableRow ( ) ; sink . tableCell ( ) ; if ( linkPath . startsWith ( "/" ) ) { linkPath = linkPath . substring ( 1 ) ; } sink . link ( linkPath ) ; String grammarFileRelativePath = sourceDire... | Create a table row containing a link to the JJDoc report for a grammar file . |
7,673 | private JJDoc newJJDoc ( ) { final JJDoc jjdoc = new JJDoc ( ) ; jjdoc . setLog ( getLog ( ) ) ; jjdoc . setGrammarEncoding ( this . grammarEncoding ) ; jjdoc . setOutputEncoding ( this . outputEncoding ) ; jjdoc . setCssHref ( this . cssHref ) ; jjdoc . setText ( this . text ) ; jjdoc . setBnf ( this . bnf ) ; jjdoc .... | Creates a new facade to invoke JJDoc . Most options for the invocation are derived from the current values of the corresponding mojo parameters . The caller is responsible to set the input file and output file on the returned facade . |
7,674 | private GrammarInfo [ ] scanForGrammars ( final File sourceDirectory ) throws MavenReportException { if ( ! sourceDirectory . isDirectory ( ) ) { return null ; } GrammarInfo [ ] grammarInfos ; getLog ( ) . debug ( "Scanning for grammars: " + sourceDirectory ) ; try { final String [ ] includes = { "**/*.jj" , "**/*.JJ" ... | Searches the specified source directory to find grammar files that can be documented . |
7,675 | public void execute ( ) throws MojoExecutionException , MojoFailureException { final GrammarInfo [ ] grammarInfos = scanForGrammars ( ) ; if ( grammarInfos == null ) { getLog ( ) . info ( "Skipping non-existing source directory: " + getSourceDirectory ( ) ) ; return ; } else if ( grammarInfos . length <= 0 ) { getLog (... | Execute the tool . |
7,676 | private GrammarInfo [ ] scanForGrammars ( ) throws MojoExecutionException { if ( ! getSourceDirectory ( ) . isDirectory ( ) ) { return null ; } GrammarInfo [ ] grammarInfos ; getLog ( ) . debug ( "Scanning for grammars: " + getSourceDirectory ( ) ) ; try { final GrammarDirectoryScanner scanner = new GrammarDirectorySca... | Scans the configured source directory for grammar files which need processing . |
7,677 | protected void deleteTempDirectory ( final File tempDirectory ) { try { FileUtils . deleteDirectory ( tempDirectory ) ; } catch ( final IOException e ) { getLog ( ) . warn ( "Failed to delete temporary directory: " + tempDirectory , e ) ; } } | Deletes the specified temporary directory . |
7,678 | private File findSourceFile ( final String filename ) { final Collection < File > sourceRoots = this . nonGeneratedSourceRoots ; for ( final File sourceRoot : sourceRoots ) { final File sourceFile = new File ( sourceRoot , filename ) ; if ( sourceFile . exists ( ) ) { return sourceFile ; } } return null ; } | Determines whether the specified source file is already present in any of the compile source roots registered with the current Maven project . |
7,679 | private void addSourceRoot ( final File directory ) { if ( this . project != null ) { getLog ( ) . debug ( "Adding compile source root: " + directory ) ; this . project . addCompileSourceRoot ( directory . getAbsolutePath ( ) ) ; } } | Registers the specified directory as a compile source root for the current project . |
7,680 | protected JavaCC newJavaCC ( ) { final JavaCC javacc = new JavaCC ( ) ; javacc . setLog ( getLog ( ) ) ; javacc . setGrammarEncoding ( this . grammarEncoding ) ; javacc . setOutputEncoding ( this . outputEncoding ) ; javacc . setJdkVersion ( this . jdkVersion ) ; javacc . setBuildParser ( this . buildParser ) ; javacc ... | Creates a new facade to invoke JavaCC . Most options for the invocation are derived from the current values of the corresponding mojo parameters . The caller is responsible to set the input file and output directory on the returned facade . |
7,681 | public static File getResourceRoot ( final URL url , final String resource ) { String path = null ; if ( url != null ) { final String spec = url . toExternalForm ( ) ; if ( ( JAR_FILE ) . regionMatches ( true , 0 , spec , 0 , JAR_FILE . length ( ) ) ) { URL jar ; try { jar = new URL ( spec . substring ( JAR . length ( ... | Gets the absolute filesystem path to the class path root for the specified resource . The root is either a JAR file or a directory with loose class files . If the URL does not use a supported protocol an exception will be thrown . |
7,682 | private JTB newJTB ( ) { final JTB jtb = new JTB ( ) ; jtb . setLog ( getLog ( ) ) ; jtb . setDescriptiveFieldNames ( this . descriptiveFieldNames ) ; jtb . setJavadocFriendlyComments ( this . javadocFriendlyComments ) ; jtb . setNodeParentClass ( this . nodeParentClass ) ; jtb . setParentPointers ( this . parentPointe... | Creates a new facade to invoke JTB . Most options for the invocation are derived from the current values of the corresponding mojo parameters . The caller is responsible to set the input file output directories and packages on the returned facade . |
7,683 | public void setSourceDirectory ( final File directory ) { if ( ! directory . isAbsolute ( ) ) { throw new IllegalArgumentException ( "source directory is not absolute: " + directory ) ; } this . scanner . setBasedir ( directory ) ; } | Sets the absolute path to the source directory to scan for grammar files . This directory must exist or the scanner will report an error . |
7,684 | public void setOutputDirectory ( final File directory ) { if ( directory != null && ! directory . isAbsolute ( ) ) { throw new IllegalArgumentException ( "output directory is not absolute: " + directory ) ; } this . outputDirectory = directory ; } | Sets the absolute path to the output directory used to detect stale target files . |
7,685 | public void scan ( ) throws IOException { this . includedGrammars . clear ( ) ; this . scanner . scan ( ) ; final String [ ] includedFiles = this . scanner . getIncludedFiles ( ) ; for ( final String includedFile : includedFiles ) { final GrammarInfo grammarInfo = new GrammarInfo ( this . scanner . getBasedir ( ) , inc... | Scans the source directory for grammar files that match at least one inclusion pattern but no exclusion pattern optionally performing timestamp checking to exclude grammars whose corresponding parser files are up to date . |
7,686 | protected File [ ] getTargetFiles ( final File targetDirectory , final String grammarFile , final GrammarInfo grammarInfo ) { final File parserFile = new File ( targetDirectory , grammarInfo . getParserFile ( ) ) ; return new File [ ] { parserFile } ; } | Determines the output files corresponding to the specified grammar file . |
7,687 | private String findPackageName ( final String grammar ) { final String packageDeclaration = "package\\s+([^\\s.;]+(\\.[^\\s.;]+)*)\\s*;" ; final Matcher matcher = Pattern . compile ( packageDeclaration ) . matcher ( grammar ) ; if ( matcher . find ( ) ) { return matcher . group ( 1 ) ; } return "" ; } | Extracts the declared package name from the specified grammar file . |
7,688 | private String findParserName ( final String grammar ) { final String parserBegin = "PARSER_BEGIN\\s*\\(\\s*([^\\s\\)]+)\\s*\\)" ; final Matcher matcher = Pattern . compile ( parserBegin ) . matcher ( grammar ) ; if ( matcher . find ( ) ) { return matcher . group ( 1 ) ; } return "" ; } | Extracts the simple parser name from the specified grammar file . |
7,689 | protected String getToolName ( ) { final String name = getClass ( ) . getName ( ) ; return name . substring ( name . lastIndexOf ( '.' ) + 1 ) ; } | Gets the name of the tool . |
7,690 | public void run ( ) throws MojoExecutionException , MojoFailureException { ESuccess exitCode ; try { if ( getLog ( ) . isDebugEnabled ( ) ) { getLog ( ) . debug ( "Running " + getToolName ( ) + ": " + this ) ; } exitCode = execute ( ) ; } catch ( final Exception e ) { throw new MojoExecutionException ( "Failed to execu... | Runs the tool using the previously set parameters . |
7,691 | public void setOutputFile ( final File value ) { if ( value != null && ! value . isAbsolute ( ) ) { throw new IllegalArgumentException ( "path is not absolute: " + value ) ; } this . outputFile = value ; } | Sets the absolute path to the output file . |
7,692 | private String [ ] _generateArguments ( ) { final List < String > argsList = new ArrayList < > ( ) ; if ( StringUtils . isNotEmpty ( this . grammarEncoding ) ) { argsList . add ( "-GRAMMAR_ENCODING=" + this . grammarEncoding ) ; } if ( StringUtils . isNotEmpty ( this . outputEncoding ) ) { argsList . add ( "-OUTPUT_ENC... | Assembles the command line arguments for the invocation of JJDoc according to the configuration . |
7,693 | public final PowerAdapter offset ( int offset ) { if ( offset <= 0 ) { return this ; } if ( offset == Integer . MAX_VALUE ) { return EMPTY ; } return new OffsetAdapter ( this , offset ) ; } | Returns a new adapter that presents all items of this adapter starting at the specified offset . |
7,694 | public final PowerAdapter limit ( int limit ) { if ( limit == Integer . MAX_VALUE ) { return this ; } if ( limit <= 0 ) { return EMPTY ; } return new LimitAdapter ( this , limit ) ; } | Returns a new adapter that presents all items of this adapter up until the specified limit . |
7,695 | private boolean shouldAnimate ( ) { if ( ! mAnimationEnabled ) { return false ; } Display display = currentDisplay ( ) ; if ( display == null ) { return false ; } if ( mVisibleStartTime <= 0 ) { return false ; } long threshold = ( long ) ( 1000 / display . getRefreshRate ( ) ) ; long millisVisible = elapsedRealtime ( )... | Returns whether now is an appropriate time to perform animations . |
7,696 | protected final void notifyChanged ( ) { for ( int i = mObservers . size ( ) - 1 ; i >= 0 ; i -- ) { mObservers . get ( i ) . onChanged ( ) ; } } | Notify observers that the condition has changed . |
7,697 | protected final void notifyError ( final Throwable e ) { checkNotNull ( e , "e" ) ; runOnUiThread ( new Runnable ( ) { public void run ( ) { mErrorObservable . notifyError ( e ) ; } } ) ; } | Dispatch an error notification on the UI thread . |
7,698 | public final < O > Data < O > filter ( final Class < O > type ) { return ( Data < O > ) new FilterData < > ( this , new Predicate < Object > ( ) { public boolean apply ( Object o ) { return type . isInstance ( o ) ; } } ) ; } | Filter this data by class . The resulting elements are guaranteed to be of the given type . |
7,699 | private void loadLoop ( ) throws InterruptedException { boolean firstItem = true ; boolean moreAvailable = true ; while ( moreAvailable ) { if ( currentThread ( ) . isInterrupted ( ) ) { throw new InterruptedException ( ) ; } try { setLoading ( true ) ; final Result < ? extends T > result = load ( ) ; moreAvailable = r... | Loads each increment until full range has been loading halting in between increment until instructed to proceed . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.