idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
33,000 | public Term parse ( String fullTextSearchExpression ) { CheckArg . isNotNull ( fullTextSearchExpression , "fullTextSearchExpression" ) ; Tokenizer tokenizer = new TermTokenizer ( ) ; TokenStream stream = new TokenStream ( fullTextSearchExpression , tokenizer , false ) ; return parse ( stream . start ( ) ) ; } | Parse the full - text search criteria given in the supplied string . |
33,001 | public Term parse ( TokenStream tokens ) { CheckArg . isNotNull ( tokens , "tokens" ) ; List < Term > terms = new ArrayList < Term > ( ) ; do { Term term = parseDisjunctedTerms ( tokens ) ; if ( term == null ) break ; terms . add ( term ) ; } while ( tokens . canConsume ( "OR" ) ) ; if ( terms . isEmpty ( ) ) return nu... | Parse the full - text search criteria from the supplied token stream . This method is useful when the full - text search expression is included in other content . |
33,002 | protected static String requireActiveTransaction ( ) { return Optional . ofNullable ( ACTIVE_TX_ID . get ( ) ) . orElseThrow ( ( ) -> new RelationalProviderException ( RelationalProviderI18n . threadNotAssociatedWithTransaction , Thread . currentThread ( ) . getName ( ) ) ) ; } | Requires that an active transaction exists for the current calling thread . |
33,003 | public static NodeSequence emptySequence ( final int width ) { assert width >= 0 ; return new NodeSequence ( ) { public int width ( ) { return width ; } public Batch nextBatch ( ) { return null ; } public long getRowCount ( ) { return 0 ; } public boolean isEmpty ( ) { return true ; } public void close ( ) { } public S... | Get an empty node sequence . |
33,004 | public static Batch emptyBatch ( final String workspaceName , final int width ) { assert width > 0 ; return new Batch ( ) { public boolean hasNext ( ) { return false ; } public String getWorkspaceName ( ) { return workspaceName ; } public int width ( ) { return width ; } public long rowCount ( ) { return 0 ; } public b... | Get a batch of nodes that is empty . |
33,005 | public static NodeSequence withBatch ( final Batch sequence ) { if ( sequence == null ) return emptySequence ( 1 ) ; return new NodeSequence ( ) { private boolean done = false ; public int width ( ) { return sequence . width ( ) ; } public long getRowCount ( ) { return sequence . rowCount ( ) ; } public boolean isEmpty... | Create a sequence of nodes that returns the supplied single batch of nodes . |
33,006 | public static NodeSequence limit ( NodeSequence sequence , Limit limitAndOffset ) { if ( sequence == null ) return emptySequence ( 0 ) ; if ( limitAndOffset != null && ! limitAndOffset . isUnlimited ( ) ) { final int limit = limitAndOffset . getRowLimit ( ) ; if ( limitAndOffset . isOffset ( ) ) { sequence = skip ( seq... | Create a sequence of nodes that skips a specified number of nodes before returning any nodes and that limits the number of nodes returned . |
33,007 | public static NodeSequence limit ( final NodeSequence sequence , final long maxRows ) { if ( sequence == null ) return emptySequence ( 0 ) ; if ( maxRows <= 0 ) return emptySequence ( sequence . width ( ) ) ; if ( sequence . isEmpty ( ) ) return sequence ; return new NodeSequence ( ) { private LimitBatch lastLimitBatch... | Create a sequence of nodes that returns at most the supplied number of rows . |
33,008 | public static NodeSequence skip ( final NodeSequence sequence , final int skip ) { if ( sequence == null ) return emptySequence ( 0 ) ; if ( skip <= 0 || sequence . isEmpty ( ) ) return sequence ; return new NodeSequence ( ) { private int rowsToSkip = skip ; public long getRowCount ( ) { long count = sequence . getRowC... | Create a sequence of nodes that skips a specified number of rows before returning any rows . |
33,009 | public static NodeSequence filter ( final NodeSequence sequence , final RowFilter filter ) { if ( sequence == null ) return emptySequence ( 0 ) ; if ( filter == null || sequence . isEmpty ( ) ) return sequence ; return new NodeSequence ( ) { public long getRowCount ( ) { return - 1 ; } public int width ( ) { return seq... | Create a sequence of nodes that all satisfy the supplied filter . |
33,010 | public static NodeSequence append ( final NodeSequence first , final NodeSequence second ) { if ( first == null ) { return second != null ? second : emptySequence ( 0 ) ; } if ( second == null ) return first ; int firstWidth = first . width ( ) ; final int secondWidth = second . width ( ) ; if ( firstWidth > 0 && secon... | Create a sequence of nodes that contains the nodes from the first sequence followed by the second sequence . |
33,011 | public static NodeSequence slice ( final NodeSequence original , Columns columns ) { final int newWidth = columns . getSelectorNames ( ) . size ( ) ; if ( original . width ( ) == newWidth ) { return original ; } final int [ ] selectorIndexes = new int [ newWidth ] ; int i = 0 ; for ( String selectorName : columns . get... | Create a sequence of nodes that include only those selectors defined by the given columns . |
33,012 | public static NodeSequence merging ( final NodeSequence first , final NodeSequence second , final int totalWidth ) { if ( first == null ) { if ( second == null ) return emptySequence ( totalWidth ) ; final int firstWidth = totalWidth - second . width ( ) ; return new NodeSequence ( ) { public int width ( ) { return tot... | Create a sequence of nodes that merges the two supplied sequences . |
33,013 | public synchronized final void initialize ( ) throws RepositoryException { if ( ! initialized ) { try { doInitialize ( ) ; initialized = true ; } catch ( RuntimeException e ) { throw new RepositoryException ( e ) ; } } } | Initialize the provider . This is called automatically by ModeShape once for each provider instance and should not be called by the provider itself . |
33,014 | public synchronized final void shutdown ( ) throws RepositoryException { preShutdown ( ) ; delegateWriter = NoOpQueryIndexWriter . INSTANCE ; try { for ( Map < String , AtomicIndex > byWorkspaceName : providedIndexesByWorkspaceNameByIndexName . values ( ) ) { for ( AtomicIndex provided : byWorkspaceName . values ( ) ) ... | Signal this provider that it is no longer needed and can release any resources that are being held . |
33,015 | public void validateDefaultColumnTypes ( ExecutionContext context , IndexDefinition defn , Problems problems ) { assert defn != null ; for ( int i = 0 ; i < defn . size ( ) ; i ++ ) { validateDefaultColumnDefinitionType ( context , defn , defn . getColumnDefinition ( i ) , problems ) ; } } | Validates that if certain default columns are present in the index definition they have a required type . |
33,016 | public final Index getIndex ( String indexName , String workspaceName ) { logger ( ) . trace ( "Looking for index '{0}' in '{1}' provider for query in workspace '{2}'" , indexName , getName ( ) , workspaceName ) ; Map < String , AtomicIndex > byWorkspaceNames = providedIndexesByWorkspaceNameByIndexName . get ( indexNam... | Get the queryable index with the given name and applicable for the given workspace . |
33,017 | public final ManagedIndex getManagedIndex ( String indexName , String workspaceName ) { logger ( ) . trace ( "Looking for managed index '{0}' in '{1}' provider in workspace '{2}'" , indexName , getName ( ) , workspaceName ) ; Map < String , AtomicIndex > byWorkspaceNames = providedIndexesByWorkspaceNameByIndexName . ge... | Get the managed index with the given name and applicable for the given workspace . |
33,018 | private final void onEachIndex ( ProvidedIndexOperation op ) { for ( String workspaceName : workspaceNames ( ) ) { Collection < AtomicIndex > indexes = providedIndexesFor ( workspaceName ) ; if ( indexes != null ) { for ( AtomicIndex atomicIndex : indexes ) { assert atomicIndex . managed ( ) != null ; assert atomicInde... | Perform the specified operation on each of the managed indexes . |
33,019 | public final void onEachIndexInWorkspace ( String workspaceName , ManagedIndexOperation op ) { assert workspaceName != null ; Collection < AtomicIndex > indexes = providedIndexesFor ( workspaceName ) ; if ( indexes != null ) { for ( AtomicIndex atomicIndex : indexes ) { assert atomicIndex . managed ( ) != null ; assert... | Perform the specified operation on each of the managed indexes in the named workspace . |
33,020 | protected ManagedIndex updateIndex ( IndexDefinition oldDefn , IndexDefinition updatedDefn , ManagedIndex existingIndex , String workspaceName , NodeTypes . Supplier nodeTypesSupplier , NodeTypePredicate matcher , IndexFeedback feedback ) { ManagedIndexBuilder builder = getIndexBuilder ( updatedDefn , workspaceName , n... | Method called when this provider needs to update an existing index given the unique pair of workspace name and index definition . An index definition can apply to multiple workspaces and when it is changed this method will be called once for each applicable workspace . |
33,021 | public List < NodeTypeDefinition > readAllNodeTypes ( ) { CachedNode nodeTypes = nodeTypesNode ( ) ; List < NodeTypeDefinition > defns = new ArrayList < NodeTypeDefinition > ( ) ; for ( ChildReference ref : nodeTypes . getChildReferences ( system ) ) { CachedNode nodeType = system . getNode ( ref ) ; defns . add ( read... | Read from system storage all of the node type definitions . |
33,022 | public Position add ( Position position ) { if ( this . getIndexInContent ( ) < 0 ) { return position . getIndexInContent ( ) < 0 ? EMPTY_CONTENT_POSITION : position ; } if ( position . getIndexInContent ( ) < 0 ) { return this ; } int index = this . getIndexInContent ( ) + position . getIndexInContent ( ) ; int line =... | Return a new position that is the addition of this position and that supplied . |
33,023 | public static ObjectId valueOf ( String uuid ) { int p = uuid . indexOf ( "/" ) ; if ( p < 0 ) { return new ObjectId ( Type . OBJECT , uuid ) ; } int p1 = p ; while ( p > 0 ) { p1 = p ; p = uuid . indexOf ( "/" , p + 1 ) ; } p = p1 ; String ident = uuid . substring ( 0 , p ) ; String type = uuid . substring ( p + 1 ) ;... | Constructs instance of this class from its textual representation . |
33,024 | protected static Document replaceSystemPropertyVariables ( Document doc ) { if ( doc . isEmpty ( ) ) return doc ; Document modified = doc . withVariablesReplacedWithSystemProperties ( ) ; if ( modified == doc ) return doc ; return SCHEMA_LIBRARY . convertValues ( modified , JSON_SCHEMA_URI ) ; } | Utility method to replace all system property variables found within the specified document . |
33,025 | public static RepositoryConfiguration read ( String resourcePathOrJsonContentString ) throws ParsingException , FileNotFoundException { CheckArg . isNotNull ( resourcePathOrJsonContentString , "resourcePathOrJsonContentString" ) ; InputStream stream = ResourceLookup . read ( resourcePathOrJsonContentString , Repository... | Read the repository configuration given by the supplied path to a file on the file system the path a classpath resource file or a string containg the actual JSON content . |
33,026 | public List < String > getNodeTypes ( ) { List < String > result = new ArrayList < String > ( ) ; List < ? > configuredNodeTypes = doc . getArray ( FieldName . NODE_TYPES ) ; if ( configuredNodeTypes != null ) { for ( Object configuredNodeType : configuredNodeTypes ) { result . add ( configuredNodeType . toString ( ) )... | Returns a list with the cnd files which should be loaded at startup . |
33,027 | public String getDefaultWorkspaceName ( ) { Document workspaces = doc . getDocument ( FieldName . WORKSPACES ) ; if ( workspaces != null ) { return workspaces . getString ( FieldName . DEFAULT , Default . DEFAULT ) ; } return Default . DEFAULT ; } | Get the name of the workspace that should be used for sessions where the client does not specify the name of the workspace . |
33,028 | public List < Component > getIndexProviders ( ) { Problems problems = new SimpleProblems ( ) ; List < Component > components = readComponents ( doc , FieldName . INDEX_PROVIDERS , FieldName . CLASSNAME , INDEX_PROVIDER_ALIASES , problems ) ; assert ! problems . hasErrors ( ) ; return components ; } | Get the ordered list of index providers defined in the configuration . |
33,029 | public DocumentOptimization getDocumentOptimization ( ) { Document storage = doc . getDocument ( FieldName . STORAGE ) ; if ( storage == null ) { storage = Schematic . newDocument ( ) ; } return new DocumentOptimization ( storage . getDocument ( FieldName . DOCUMENT_OPTIMIZATION ) ) ; } | Get the configuration for the document optimization for this repository . |
33,030 | public void writeTo ( WritableByteChannel channel ) throws IOException { int numberOfBytesToWrite = size ; for ( ByteBuffer buffer : buffers ) { if ( buffer == null ) { continue ; } int numBytesInBuffer = Math . min ( numberOfBytesToWrite , bufferSize ) ; buffer . position ( numBytesInBuffer ) ; buffer . flip ( ) ; cha... | Write all content to the supplied channel . |
33,031 | public final int applyUpgradesSince ( int lastId , Context resources ) { int lastUpgradeId = lastId ; for ( UpgradeOperation op : operations ) { if ( op . getId ( ) <= lastId ) continue ; LOGGER . debug ( "Upgrade {0}: starting" , op ) ; op . apply ( resources ) ; LOGGER . debug ( "Upgrade {0}: complete" , op ) ; lastU... | Apply any upgrades that are more recent than identified by the last upgraded identifier . |
33,032 | public static org . modeshape . jcr . api . Logger getLogger ( Class < ? > clazz ) { return new ExtensionLogger ( Logger . getLogger ( clazz ) ) ; } | Creates a new logger instance for the underlying class . |
33,033 | private void createIndex ( ) { try { client . createIndex ( name ( ) , workspace , columns . mappings ( workspace ) ) ; client . flush ( name ( ) ) ; } catch ( IOException e ) { throw new EsIndexException ( e ) ; } } | Executes create index action . |
33,034 | private EsRequest find ( String nodeKey ) throws IOException { return client . getDocument ( name ( ) , workspace , nodeKey ) ; } | Searches indexed node s properties by node key . |
33,035 | private EsRequest findOrCreateDoc ( String nodeKey ) throws IOException { EsRequest doc = client . getDocument ( name ( ) , workspace , nodeKey ) ; return doc != null ? doc : new EsRequest ( ) ; } | Searches indexed node s properties by node key or creates new empty list . |
33,036 | private void putValue ( EsRequest doc , EsIndexColumn column , Object value ) { Object columnValue = column . columnValue ( value ) ; String stringValue = column . stringValue ( value ) ; doc . put ( column . getName ( ) , columnValue ) ; if ( ! ( value instanceof ModeShapeDateTime || value instanceof Long || value ins... | Appends specified value for the given column and related pseudo columns into list of properties . |
33,037 | private void putValues ( EsRequest doc , EsIndexColumn column , Object [ ] value ) { Object [ ] columnValue = column . columnValues ( value ) ; int [ ] ln = new int [ columnValue . length ] ; String [ ] lc = new String [ columnValue . length ] ; String [ ] uc = new String [ columnValue . length ] ; for ( int i = 0 ; i ... | Appends specified values for the given column and related pseudo columns into list of properties . |
33,038 | protected void processIdent ( DetailAST aAST ) { final int parentType = aAST . getParent ( ) . getType ( ) ; if ( ( ( parentType != TokenTypes . DOT ) && ( parentType != TokenTypes . METHOD_DEF ) ) || ( ( parentType == TokenTypes . DOT ) && ( aAST . getNextSibling ( ) != null ) ) ) { referenced . add ( aAST . getText (... | Collects references made by IDENT . |
33,039 | private void processImport ( DetailAST aAST ) { final FullIdent name = FullIdent . createFullIdentBelow ( aAST ) ; if ( ( name != null ) && ! name . getText ( ) . endsWith ( ".*" ) ) { imports . add ( name ) ; } } | Collects the details of imports . |
33,040 | private void processStaticImport ( DetailAST aAST ) { final FullIdent name = FullIdent . createFullIdent ( aAST . getFirstChild ( ) . getNextSibling ( ) ) ; if ( ( name != null ) && ! name . getText ( ) . endsWith ( ".*" ) ) { imports . add ( name ) ; } } | Collects the details of static imports . |
33,041 | public PrivilegeImpl forName ( String name ) { if ( name . contains ( "}" ) ) { String localName = name . substring ( name . indexOf ( '}' ) + 1 ) ; return privileges . get ( localName ) ; } if ( name . contains ( ":" ) ) { String localName = name . substring ( name . indexOf ( ':' ) + 1 ) ; PrivilegeImpl p = privilege... | Searches privilege object for the privilege with the given name . |
33,042 | public void setChangedNodes ( Set < NodeKey > keys ) { if ( keys != null ) { this . nodeKeys = Collections . unmodifiableSet ( new HashSet < NodeKey > ( keys ) ) ; } } | Sets the list of node keys involved in this change set . |
33,043 | public static boolean hasWildcardCharacters ( String expression ) { Objects . requireNonNull ( expression ) ; CharacterIterator iter = new StringCharacterIterator ( expression ) ; boolean skipNext = false ; for ( char c = iter . first ( ) ; c != CharacterIterator . DONE ; c = iter . next ( ) ) { if ( skipNext ) { skipN... | Checks if the given expression has any wildcard characters |
33,044 | public static String toRegularExpression ( String likeExpression ) { String result = likeExpression . replaceAll ( "\\\\(.)" , "$1" ) ; result = result . replaceAll ( "([$.|+()\\[\\\\^\\\\\\\\])" , "\\\\$1" ) ; result = result . replace ( "*" , ".*" ) . replace ( "?" , "." ) ; result = result . replace ( "%" , ".*" ) .... | Convert the JCR like expression to a regular expression . The JCR like expression uses % to match 0 or more characters _ to match any single character \ x to match the x character and all other characters to match themselves . Note that if any regex metacharacters appear in the like expression they will be escaped with... |
33,045 | public String [ ] getAttributeNames ( ) { synchronized ( attributes ) { return attributes . keySet ( ) . toArray ( new String [ attributes . keySet ( ) . size ( ) ] ) ; } } | Returns the names of the attributes available to this credentials instance . This method returns an empty array if the credentials instance has no attributes available to it . |
33,046 | protected boolean appliesToPathConstraint ( List < Component > predicates ) { if ( predicates . isEmpty ( ) ) return true ; if ( predicates . size ( ) > 1 ) return false ; assert predicates . size ( ) == 1 ; Component predicate = predicates . get ( 0 ) ; if ( predicate instanceof Literal && ( ( Literal ) predicate ) . ... | Determine if the predicates contain any expressions that cannot be put into a LIKE constraint on the path . |
33,047 | static BinaryStorage defaultConfig ( ) { EditableDocument binaries = Schematic . newDocument ( ) ; binaries . set ( RepositoryConfiguration . FieldName . TYPE , RepositoryConfiguration . FieldValue . BINARY_STORAGE_TYPE_TRANSIENT ) ; return new BinaryStorage ( binaries ) ; } | Creates a default storage configuration which will be used whenever no specific binary store is configured . |
33,048 | private static void localize ( final Class < ? > i18nClass , final Locale locale ) { assert i18nClass != null ; assert locale != null ; Map < Class < ? > , Set < String > > classToProblemsMap = new ConcurrentHashMap < Class < ? > , Set < String > > ( ) ; Map < Class < ? > , Set < String > > existingClassToProblemsMap =... | Synchronized on the supplied internalization class . |
33,049 | public String text ( Locale locale , Object ... arguments ) { try { String rawText = rawText ( locale == null ? Locale . getDefault ( ) : locale ) ; return StringUtil . createString ( rawText , arguments ) ; } catch ( IllegalArgumentException err ) { throw new IllegalArgumentException ( CommonI18n . i18nRequiredToSuppl... | Get the localized text for the supplied locale replacing the parameters in the text with those supplied . |
33,050 | protected DocumentBuilder getDocumentBuilder ( ) throws ServletException { DocumentBuilder documentBuilder = null ; DocumentBuilderFactory documentBuilderFactory = null ; try { documentBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; documentBuilderFactory . setNamespaceAware ( true ) ; documentBuilder = doc... | Return JAXP document builder instance . |
33,051 | public boolean indexAppliesTo ( JoinCondition condition ) { if ( condition instanceof ChildNodeJoinCondition ) { return indexAppliesTo ( ( ChildNodeJoinCondition ) condition ) ; } if ( condition instanceof DescendantNodeJoinCondition ) { return indexAppliesTo ( ( DescendantNodeJoinCondition ) condition ) ; } if ( condi... | Determine if this index can be used to evaluate the given join condition . |
33,052 | public boolean indexAppliesTo ( Constraint constraint ) { if ( constraint instanceof Comparison ) { return indexAppliesTo ( ( Comparison ) constraint ) ; } if ( constraint instanceof And ) { return indexAppliesTo ( ( And ) constraint ) ; } if ( constraint instanceof Or ) { return indexAppliesTo ( ( Or ) constraint ) ; ... | Determine if this index can be used to evaluate the given constraint . |
33,053 | private void aggregate ( ArrayList < Privilege > list , Privilege p ) { list . add ( p ) ; if ( p . isAggregate ( ) ) { for ( Privilege ap : p . getDeclaredAggregatePrivileges ( ) ) { aggregate ( list , ap ) ; } } } | Recursively aggregates privileges for the given privilege . |
33,054 | public boolean contains ( Privilege p ) { if ( p . getName ( ) . equalsIgnoreCase ( this . getName ( ) ) ) { return true ; } Privilege [ ] list = getAggregatePrivileges ( ) ; for ( Privilege privilege : list ) { if ( privilege . getName ( ) . equalsIgnoreCase ( p . getName ( ) ) ) { return true ; } } return false ; } | Tests given privilege . |
33,055 | void save ( AbstractJcrNode node ) throws RepositoryException { Set < NodeKey > keysToBeSaved = null ; try { if ( node . isNew ( ) ) { throw new RepositoryException ( JcrI18n . unableToSaveNodeThatWasCreatedSincePreviousSave . text ( node . getPath ( ) , workspaceName ( ) ) ) ; } AtomicReference < Set < NodeKey > > ref... | Save a subset of the changes made within this session . |
33,056 | static boolean hasRole ( SecurityContext context , String roleName , String repositoryName , String workspaceName ) { if ( context . hasRole ( roleName ) ) return true ; roleName = roleName + "." + repositoryName ; if ( context . hasRole ( roleName ) ) return true ; roleName = roleName + "." + workspaceName ; return co... | Returns whether the authenticated user has the given role . |
33,057 | public static boolean isForeignKey ( NodeKey key , NodeKey rootKey ) { if ( key == null ) { return false ; } String nodeWorkspaceKey = key . getWorkspaceKey ( ) ; boolean sameWorkspace = rootKey . getWorkspaceKey ( ) . equals ( nodeWorkspaceKey ) ; boolean sameSource = rootKey . getSourceKey ( ) . equalsIgnoreCase ( ke... | Checks if the node given key is foreign by comparing the source key & workspace key against the same keys from this session s root . This method is used for reference resolving . |
33,058 | public static String nodeIdentifier ( NodeKey key , NodeKey rootKey ) { return isForeignKey ( key , rootKey ) ? key . toString ( ) : key . getIdentifier ( ) ; } | Returns a string representing a node s identifier based on whether the node is foreign or not . |
33,059 | public int computeNextStatementStartKeywordCount ( ) { int result = 0 ; if ( isNextKeyWord ( ) ) { for ( String [ ] nextStmtStart : registeredStatementStartPhrases ) { if ( this . matches ( nextStmtStart ) ) { return nextStmtStart . length ; } } } return result ; } | Method to determine if next tokens match a registered statement start phrase . |
33,060 | protected void parse ( String content ) { Tokenizer tokenizer = new CndTokenizer ( false , true ) ; TokenStream tokens = new TokenStream ( content , tokenizer , false ) ; tokens . start ( ) ; while ( tokens . hasNext ( ) ) { if ( tokens . matches ( "<" , ANY_VALUE , "=" , ANY_VALUE , ">" ) ) { parseNamespaceMapping ( t... | Parse the CND content . |
33,061 | protected void parseNamespaceMapping ( TokenStream tokens ) { tokens . consume ( '<' ) ; String prefix = removeQuotes ( tokens . consume ( ) ) ; tokens . consume ( '=' ) ; String uri = removeQuotes ( tokens . consume ( ) ) ; tokens . consume ( '>' ) ; context . getNamespaceRegistry ( ) . register ( prefix , uri ) ; } | Parse the namespace mapping statement that is next on the token stream . |
33,062 | protected void parseNodeTypeDefinition ( TokenStream tokens ) { Name name = parseNodeTypeName ( tokens ) ; JcrNodeTypeTemplate nodeType = new JcrNodeTypeTemplate ( context ) ; try { nodeType . setName ( string ( name ) ) ; } catch ( ConstraintViolationException e ) { assert false : "Names should always be syntactically... | Parse the node type definition that is next on the token stream . |
33,063 | protected Name parseNodeTypeName ( TokenStream tokens ) { tokens . consume ( '[' ) ; Name name = parseName ( tokens ) ; tokens . consume ( ']' ) ; return name ; } | Parse a node type name that appears next on the token stream . |
33,064 | protected List < Name > parseSupertypes ( TokenStream tokens ) { if ( tokens . canConsume ( '>' ) ) { return parseNameList ( tokens ) ; } return Collections . emptyList ( ) ; } | Parse an optional list of supertypes if they appear next on the token stream . |
33,065 | protected List < String > parseStringList ( TokenStream tokens ) { List < String > strings = new ArrayList < String > ( ) ; if ( tokens . canConsume ( '?' ) ) { strings . add ( "?" ) ; } else { do { strings . add ( removeQuotes ( tokens . consume ( ) ) ) ; } while ( tokens . canConsume ( ',' ) ) ; } return strings ; } | Parse a list of strings separated by commas . Any quotes surrounding the strings are removed . |
33,066 | protected List < Name > parseNameList ( TokenStream tokens ) { List < Name > names = new ArrayList < Name > ( ) ; if ( ! tokens . canConsume ( '?' ) ) { do { names . add ( parseName ( tokens ) ) ; } while ( tokens . canConsume ( ',' ) ) ; } return names ; } | Parse a list of names separated by commas . Any quotes surrounding the names are removed . |
33,067 | protected void parsePropertyOrChildNodeDefinitions ( TokenStream tokens , JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException { while ( true ) { if ( tokens . matches ( '-' ) ) { parsePropertyDefinition ( tokens , nodeType ) ; } else if ( tokens . matches ( '+' ) ) { parseChildNodeDefinition ( tokens , n... | Parse a node type s property or child node definitions that appear next on the token stream . |
33,068 | protected void parsePropertyDefinition ( TokenStream tokens , JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException { tokens . consume ( '-' ) ; Name name = parseName ( tokens ) ; JcrPropertyDefinitionTemplate propDefn = new JcrPropertyDefinitionTemplate ( context ) ; propDefn . setName ( string ( name ) )... | Parse a node type s property definition from the next tokens on the stream . |
33,069 | protected void parsePropertyType ( TokenStream tokens , JcrPropertyDefinitionTemplate propDefn , String defaultPropertyType ) { if ( tokens . canConsume ( '(' ) ) { String propertyType = defaultPropertyType ; if ( tokens . matchesAnyOf ( VALID_PROPERTY_TYPES ) ) { propertyType = tokens . consume ( ) ; if ( "*" . equals... | Parse the property type if a valid one appears next on the token stream . |
33,070 | protected void parseDefaultValues ( TokenStream tokens , JcrPropertyDefinitionTemplate propDefn ) { if ( tokens . canConsume ( '=' ) ) { List < String > defaultValues = parseStringList ( tokens ) ; if ( ! defaultValues . isEmpty ( ) ) { propDefn . setDefaultValues ( values ( defaultValues ) ) ; } } } | Parse the property definition s default value if they appear next on the token stream . |
33,071 | protected void parseValueConstraints ( TokenStream tokens , JcrPropertyDefinitionTemplate propDefn ) { if ( tokens . canConsume ( '<' ) ) { List < String > defaultValues = parseStringList ( tokens ) ; if ( ! defaultValues . isEmpty ( ) ) { propDefn . setValueConstraints ( strings ( defaultValues ) ) ; } } } | Parse the property definition s value constraints if they appear next on the token stream . |
33,072 | protected void parsePropertyAttributes ( TokenStream tokens , JcrPropertyDefinitionTemplate propDefn , JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException { boolean autoCreated = false ; boolean mandatory = false ; boolean isProtected = false ; boolean multiple = false ; boolean isFullTextSearchable = tr... | Parse the property definition s attributes if they appear next on the token stream . |
33,073 | protected void parseQueryOperators ( TokenStream tokens , JcrPropertyDefinitionTemplate propDefn ) { if ( tokens . canConsume ( '?' ) ) { return ; } List < String > operators = new ArrayList < String > ( ) ; String operatorList = removeQuotes ( tokens . consume ( ) ) ; for ( String operatorValue : operatorList . split ... | Parse the property definition s query operators if they appear next on the token stream . |
33,074 | protected void parseChildNodeDefinition ( TokenStream tokens , JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException { tokens . consume ( '+' ) ; Name name = parseName ( tokens ) ; JcrNodeDefinitionTemplate childDefn = new JcrNodeDefinitionTemplate ( context ) ; childDefn . setName ( string ( name ) ) ; pa... | Parse a node type s child node definition from the next tokens on the stream . |
33,075 | protected void parseRequiredPrimaryTypes ( TokenStream tokens , JcrNodeDefinitionTemplate childDefn ) throws ConstraintViolationException { if ( tokens . canConsume ( '(' ) ) { List < Name > requiredTypes = parseNameList ( tokens ) ; if ( requiredTypes . isEmpty ( ) ) { requiredTypes . add ( JcrNtLexicon . BASE ) ; } c... | Parse the child node definition s list of required primary types if they appear next on the token stream . |
33,076 | protected void parseDefaultType ( TokenStream tokens , JcrNodeDefinitionTemplate childDefn ) throws ConstraintViolationException { if ( tokens . canConsume ( '=' ) ) { if ( ! tokens . canConsume ( '?' ) ) { Name defaultType = parseName ( tokens ) ; childDefn . setDefaultPrimaryTypeName ( string ( defaultType ) ) ; } } ... | Parse the child node definition s default type if they appear next on the token stream . |
33,077 | protected void parseNodeAttributes ( TokenStream tokens , JcrNodeDefinitionTemplate childDefn , JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException { boolean autoCreated = false ; boolean mandatory = false ; boolean isProtected = false ; boolean sns = false ; String onParentVersion = "COPY" ; while ( tru... | Parse the child node definition s attributes if they appear next on the token stream . |
33,078 | protected Name parseName ( TokenStream tokens ) { String value = tokens . consume ( ) ; try { return nameFactory . create ( removeQuotes ( value ) ) ; } catch ( ValueFormatException e ) { if ( e . getCause ( ) instanceof NamespaceException ) { throw ( NamespaceException ) e . getCause ( ) ; } throw new ParsingException... | Parse the name that is expected to be next on the token stream . |
33,079 | protected final void parseVendorExtensions ( TokenStream tokens , List < Property > properties ) { while ( tokens . matches ( CndTokenizer . VENDOR_EXTENSION ) ) { Property extension = parseVendorExtension ( tokens . consume ( ) ) ; if ( extension != null ) properties . add ( extension ) ; } } | Parse the vendor extensions that may appear next on the tokenzied stream . |
33,080 | protected final Property parseVendorExtension ( String vendorExtension ) { if ( vendorExtension == null ) return null ; String extension = vendorExtension . replaceFirst ( "^[{]" , "" ) . replaceAll ( "[}]$" , "" ) ; if ( extension . trim ( ) . length ( ) == 0 ) return null ; return parseVendorExtensionContent ( extens... | Parse the vendor extension including the curly braces in the CND content . |
33,081 | protected final Property parseVendorExtensionContent ( String vendorExtension ) { Matcher matcher = VENDOR_PATTERN . matcher ( vendorExtension ) ; if ( ! matcher . find ( ) ) return null ; String vendorName = removeQuotes ( matcher . group ( 1 ) ) ; String vendorValue = removeQuotes ( matcher . group ( 3 ) ) ; assert v... | Parse the content of the vendor extension excluding the curly braces in the CND content . |
33,082 | public WorkspaceCache createWorkspace ( String name ) { if ( ! workspaceNames . contains ( name ) ) { if ( ! configuration . isCreatingWorkspacesAllowed ( ) ) { throw new UnsupportedOperationException ( JcrI18n . creatingWorkspacesIsNotAllowedInRepository . text ( getName ( ) ) ) ; } this . workspaceNames . add ( name ... | Create a new workspace in this repository if the repository is appropriately configured . If the repository already contains a workspace with the supplied name then this method simply returns that workspace . Otherwise this method attempts to create the named workspace and will return a cache for this newly - created w... |
33,083 | public WorkspaceCache createExternalWorkspace ( String name , Connectors connectors ) { String [ ] tokens = name . split ( ":" ) ; String sourceName = tokens [ 0 ] ; String workspaceName = tokens [ 1 ] ; this . workspaceNames . add ( workspaceName ) ; refreshRepositoryMetadata ( true ) ; ConcurrentMap < NodeKey , Cache... | Creates a new workspace in the repository coupled with external document store . |
33,084 | public SessionCache createSession ( ExecutionContext context , String workspaceName , boolean readOnly ) { WorkspaceCache workspaceCache = workspace ( workspaceName ) ; if ( readOnly ) { return new ReadOnlySessionCache ( context , workspaceCache ) ; } return new WritableSessionCache ( context , workspaceCache , txWorks... | Create a session for the workspace with the given name using the supplied ExecutionContext for the session . |
33,085 | public void setColumnStartPositions ( String commaDelimitedColumnStartPositions ) { CheckArg . isNotNull ( commaDelimitedColumnStartPositions , "commaDelimitedColumnStartPositions" ) ; String [ ] stringStartPositions = commaDelimitedColumnStartPositions . split ( "," ) ; int [ ] columnStartPositions = new int [ stringS... | Set the column start positions from a list of column start positions concatenated into a single comma - delimited string . |
33,086 | private static Set < String > setFor ( String ... elements ) { Set < String > set = new HashSet < String > ( elements . length ) ; set . addAll ( Arrays . asList ( elements ) ) ; return set ; } | Returns an unmodifiable set containing the elements passed in to this method |
33,087 | public void changeField ( MappedAttributeDefinition defn , ModelNode newValue ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryConfiguration ( repositoryName ) ; Editor e... | Immediately change and apply the specified field in the current repository configuration to the new value . |
33,088 | public void changeIndexProviderField ( MappedAttributeDefinition defn , ModelNode newValue , String indexProviderName ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryCon... | Immediately change and apply the specified index provider field in the current repository configuration to the new value . |
33,089 | public void changeSequencerField ( MappedAttributeDefinition defn , ModelNode newValue , String sequencerName ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryConfigurati... | Immediately change and apply the specified sequencer field in the current repository configuration to the new value . |
33,090 | public void changePersistenceField ( MappedAttributeDefinition defn , ModelNode newValue ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryConfiguration ( repositoryName )... | Immediately change and apply the specified persistence field to the repository configuration |
33,091 | public void changeSourceField ( MappedAttributeDefinition defn , ModelNode newValue , String sourceName ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryConfiguration ( r... | Immediately change and apply the specified external source field in the current repository configuration to the new value . |
33,092 | public void changeTextExtractorField ( MappedAttributeDefinition defn , ModelNode newValue , String extractorName ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryConfigu... | Immediately change and apply the specified extractor field in the current repository configuration to the new value . |
33,093 | public void changeAuthenticatorField ( MappedAttributeDefinition defn , ModelNode newValue , String authenticatorName ) throws RepositoryException , OperationFailedException { ModeShapeEngine engine = getEngine ( ) ; String repositoryName = repositoryName ( ) ; RepositoryConfiguration config = engine . getRepositoryCon... | Immediately change and apply the specified authenticator field in the current repository configuration to the new value . |
33,094 | public boolean checkLocks ( boolean exclusive , int depth ) { if ( checkParents ( exclusive ) && checkChildren ( exclusive , depth ) ) { return true ; } return false ; } | checks if a lock of the given exclusivity can be placed only considering children up to depth |
33,095 | public Predicate < T > and ( final Predicate < T > other ) { if ( other == null || other == this ) return this ; return new Predicate < T > ( ) { public boolean test ( T input ) { return Predicate . this . test ( input ) && other . test ( input ) ; } } ; } | Obtain a new predicate that performs the logical AND of this predicate and the supplied predicate . |
33,096 | public Predicate < T > or ( final Predicate < T > other ) { if ( other == null || other == this ) return this ; return new Predicate < T > ( ) { public boolean test ( T input ) { return Predicate . this . test ( input ) || other . test ( input ) ; } } ; } | Obtain a new predicate that performs the logical OR of this predicate and the supplied predicate . |
33,097 | public Predicate < T > negate ( ) { return new Predicate < T > ( ) { public boolean test ( T input ) { return ! Predicate . this . test ( input ) ; } public Predicate < T > negate ( ) { return Predicate . this ; } } ; } | Obtain a new predicate that performs the logical NOT of this predicate . |
33,098 | public static < T > Predicate < T > never ( ) { return new Predicate < T > ( ) { public boolean test ( T input ) { return false ; } } ; } | Return a predicate that is never satisfied . |
33,099 | public static < T > Predicate < T > always ( ) { return new Predicate < T > ( ) { public boolean test ( T input ) { return true ; } } ; } | Return a predicate that is always satisfied . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.