repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java | FullTextSearchParser.parse | public Term parse( String fullTextSearchExpression ) {
CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression");
Tokenizer tokenizer = new TermTokenizer();
TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false);
return parse(stream.start());
... | java | public Term parse( String fullTextSearchExpression ) {
CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression");
Tokenizer tokenizer = new TermTokenizer();
TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false);
return parse(stream.start());
... | [
"public",
"Term",
"parse",
"(",
"String",
"fullTextSearchExpression",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"fullTextSearchExpression",
",",
"\"fullTextSearchExpression\"",
")",
";",
"Tokenizer",
"tokenizer",
"=",
"new",
"TermTokenizer",
"(",
")",
";",
"Token... | Parse the full-text search criteria given in the supplied string.
@param fullTextSearchExpression the full-text search expression; may not be null
@return the term representation of the full-text search, or null if there are no terms
@throws ParsingException if there is an error parsing the supplied string
@throws Ill... | [
"Parse",
"the",
"full",
"-",
"text",
"search",
"criteria",
"given",
"in",
"the",
"supplied",
"string",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java#L121-L126 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java | FullTextSearchParser.parse | 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"));
... | java | 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"));
... | [
"public",
"Term",
"parse",
"(",
"TokenStream",
"tokens",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"tokens",
",",
"\"tokens\"",
")",
";",
"List",
"<",
"Term",
">",
"terms",
"=",
"new",
"ArrayList",
"<",
"Term",
">",
"(",
")",
";",
"do",
"{",
"Term... | 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.
@param tokens the token stream containing the full-text search starting on the next token
@return the term representation of the full-text search, or null if ther... | [
"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",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java#L137-L147 | train |
ModeShape/modeshape | persistence/modeshape-persistence-relational/src/main/java/org/modeshape/persistence/relational/TransactionsHolder.java | TransactionsHolder.requireActiveTransaction | protected static String requireActiveTransaction() {
return Optional.ofNullable(ACTIVE_TX_ID.get()).orElseThrow(() -> new RelationalProviderException(
RelationalProviderI18n.threadNotAssociatedWithTransaction,
Thread.currentThread().getName()));
} | java | protected static String requireActiveTransaction() {
return Optional.ofNullable(ACTIVE_TX_ID.get()).orElseThrow(() -> new RelationalProviderException(
RelationalProviderI18n.threadNotAssociatedWithTransaction,
Thread.currentThread().getName()));
} | [
"protected",
"static",
"String",
"requireActiveTransaction",
"(",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"ACTIVE_TX_ID",
".",
"get",
"(",
")",
")",
".",
"orElseThrow",
"(",
"(",
")",
"->",
"new",
"RelationalProviderException",
"(",
"RelationalPr... | Requires that an active transaction exists for the current calling thread.
@return the ID of the active transaction, never {@code null}
@throws RelationalProviderException if the current thread is not associated with a transaction. | [
"Requires",
"that",
"an",
"active",
"transaction",
"exists",
"for",
"the",
"current",
"calling",
"thread",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/persistence/modeshape-persistence-relational/src/main/java/org/modeshape/persistence/relational/TransactionsHolder.java#L45-L49 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.emptySequence | public static NodeSequence emptySequence( final int width ) {
assert width >= 0;
return new NodeSequence() {
@Override
public int width() {
return width;
}
@Override
public Batch nextBatch() {
return null;
... | java | public static NodeSequence emptySequence( final int width ) {
assert width >= 0;
return new NodeSequence() {
@Override
public int width() {
return width;
}
@Override
public Batch nextBatch() {
return null;
... | [
"public",
"static",
"NodeSequence",
"emptySequence",
"(",
"final",
"int",
"width",
")",
"{",
"assert",
"width",
">=",
"0",
";",
"return",
"new",
"NodeSequence",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"width",
"(",
")",
"{",
"return",
"width",
"... | Get an empty node sequence.
@param width the width of the batches; must be positive
@return the empty node sequence; never null | [
"Get",
"an",
"empty",
"node",
"sequence",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L184-L216 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.emptyBatch | public static Batch emptyBatch( final String workspaceName,
final int width ) {
assert width > 0;
return new Batch() {
@Override
public boolean hasNext() {
return false;
}
@Override
public St... | java | public static Batch emptyBatch( final String workspaceName,
final int width ) {
assert width > 0;
return new Batch() {
@Override
public boolean hasNext() {
return false;
}
@Override
public St... | [
"public",
"static",
"Batch",
"emptyBatch",
"(",
"final",
"String",
"workspaceName",
",",
"final",
"int",
"width",
")",
"{",
"assert",
"width",
">",
"0",
";",
"return",
"new",
"Batch",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
"... | Get a batch of nodes that is empty.
@param workspaceName the name of the workspace
@param width the width of the batch; must be positive
@return the empty node batch; never null | [
"Get",
"a",
"batch",
"of",
"nodes",
"that",
"is",
"empty",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L225-L284 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.withBatch | public static NodeSequence withBatch( final Batch sequence ) {
if (sequence == null) return emptySequence(1);
return new NodeSequence() {
private boolean done = false;
@Override
public int width() {
return sequence.width();
}
... | java | public static NodeSequence withBatch( final Batch sequence ) {
if (sequence == null) return emptySequence(1);
return new NodeSequence() {
private boolean done = false;
@Override
public int width() {
return sequence.width();
}
... | [
"public",
"static",
"NodeSequence",
"withBatch",
"(",
"final",
"Batch",
"sequence",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"return",
"emptySequence",
"(",
"1",
")",
";",
"return",
"new",
"NodeSequence",
"(",
")",
"{",
"private",
"boolean",
"do... | Create a sequence of nodes that returns the supplied single batch of nodes.
@param sequence the node keys to be returned; if null, an {@link #emptySequence empty instance} is returned
@return the sequence of nodes; never null | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"returns",
"the",
"supplied",
"single",
"batch",
"of",
"nodes",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L292-L328 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.limit | public static NodeSequence limit( NodeSequence sequence,
Limit limitAndOffset ) {
if (sequence == null) return emptySequence(0);
if (limitAndOffset != null && !limitAndOffset.isUnlimited()) {
final int limit = limitAndOffset.getRowLimit();
//... | java | public static NodeSequence limit( NodeSequence sequence,
Limit limitAndOffset ) {
if (sequence == null) return emptySequence(0);
if (limitAndOffset != null && !limitAndOffset.isUnlimited()) {
final int limit = limitAndOffset.getRowLimit();
//... | [
"public",
"static",
"NodeSequence",
"limit",
"(",
"NodeSequence",
"sequence",
",",
"Limit",
"limitAndOffset",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"return",
"emptySequence",
"(",
"0",
")",
";",
"if",
"(",
"limitAndOffset",
"!=",
"null",
"&&",
... | Create a sequence of nodes that skips a specified number of nodes before returning any nodes and that limits the number of
nodes returned.
@param sequence the original sequence that is to be limited; may be null
@param limitAndOffset the specification of the offset and limit; if null this method simply returns <code>s... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"skips",
"a",
"specified",
"number",
"of",
"nodes",
"before",
"returning",
"any",
"nodes",
"and",
"that",
"limits",
"the",
"number",
"of",
"nodes",
"returned",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L619-L634 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.limit | 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 NodeSeq... | java | 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 NodeSeq... | [
"public",
"static",
"NodeSequence",
"limit",
"(",
"final",
"NodeSequence",
"sequence",
",",
"final",
"long",
"maxRows",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"return",
"emptySequence",
"(",
"0",
")",
";",
"if",
"(",
"maxRows",
"<=",
"0",
")... | Create a sequence of nodes that returns at most the supplied number of rows.
@param sequence the original sequence that is to be limited; may be null
@param maxRows the maximum number of rows that are to be returned by the sequence; should be positive or this method simply
returns <code>sequence</code>
@return the seq... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"returns",
"at",
"most",
"the",
"supplied",
"number",
"of",
"rows",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L644-L713 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.skip | 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;
... | java | 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",
"static",
"NodeSequence",
"skip",
"(",
"final",
"NodeSequence",
"sequence",
",",
"final",
"int",
"skip",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"return",
"emptySequence",
"(",
"0",
")",
";",
"if",
"(",
"skip",
"<=",
"0",
"||",
"s... | Create a sequence of nodes that skips a specified number of rows before returning any rows.
@param sequence the original sequence that is to be limited; may be null
@param skip the number of initial rows that should be skipped; should be positive or this method simply returns
<code>sequence</code>
@return the sequence... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"skips",
"a",
"specified",
"number",
"of",
"rows",
"before",
"returning",
"any",
"rows",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L723-L797 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.filter | 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() {
@Override
... | java | 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() {
@Override
... | [
"public",
"static",
"NodeSequence",
"filter",
"(",
"final",
"NodeSequence",
"sequence",
",",
"final",
"RowFilter",
"filter",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"return",
"emptySequence",
"(",
"0",
")",
";",
"if",
"(",
"filter",
"==",
"null... | Create a sequence of nodes that all satisfy the supplied filter.
@param sequence the original sequence that is to be limited; may be null
@param filter the filter to apply to the nodes; if null this method simply returns <code>sequence</code>
@return the sequence of filtered nodes; never null | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"all",
"satisfy",
"the",
"supplied",
"filter",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L947-L986 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.append | 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();
... | java | 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();
... | [
"public",
"static",
"NodeSequence",
"append",
"(",
"final",
"NodeSequence",
"first",
",",
"final",
"NodeSequence",
"second",
")",
"{",
"if",
"(",
"first",
"==",
"null",
")",
"{",
"return",
"second",
"!=",
"null",
"?",
"second",
":",
"emptySequence",
"(",
"... | Create a sequence of nodes that contains the nodes from the first sequence followed by the second sequence.
@param first the first sequence; may be null
@param second the second sequence; may be null
@return the new combined sequence; never null
@throws IllegalArgumentException if the sequences have different widths | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"contains",
"the",
"nodes",
"from",
"the",
"first",
"sequence",
"followed",
"by",
"the",
"second",
"sequence",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L996-L1054 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.slice | public static NodeSequence slice( final NodeSequence original,
Columns columns ) {
final int newWidth = columns.getSelectorNames().size();
if (original.width() == newWidth) {
return original;
}
// We need to return a NodeSequence that inc... | java | public static NodeSequence slice( final NodeSequence original,
Columns columns ) {
final int newWidth = columns.getSelectorNames().size();
if (original.width() == newWidth) {
return original;
}
// We need to return a NodeSequence that inc... | [
"public",
"static",
"NodeSequence",
"slice",
"(",
"final",
"NodeSequence",
"original",
",",
"Columns",
"columns",
")",
"{",
"final",
"int",
"newWidth",
"=",
"columns",
".",
"getSelectorNames",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"original",
".... | Create a sequence of nodes that include only those selectors defined by the given columns.
@param original the original node sequence that might have more selectors than specified by the columns
@param columns the columns defining the selectors that are to be exposed
@return the node sequence; never null but possibly ... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"include",
"only",
"those",
"selectors",
"defined",
"by",
"the",
"given",
"columns",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1063-L1111 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.merging | public static NodeSequence merging( final NodeSequence first,
final NodeSequence second,
final int totalWidth ) {
if (first == null) {
if (second == null) return emptySequence(totalWidth);
final int firstWidt... | java | public static NodeSequence merging( final NodeSequence first,
final NodeSequence second,
final int totalWidth ) {
if (first == null) {
if (second == null) return emptySequence(totalWidth);
final int firstWidt... | [
"public",
"static",
"NodeSequence",
"merging",
"(",
"final",
"NodeSequence",
"first",
",",
"final",
"NodeSequence",
"second",
",",
"final",
"int",
"totalWidth",
")",
"{",
"if",
"(",
"first",
"==",
"null",
")",
"{",
"if",
"(",
"second",
"==",
"null",
")",
... | Create a sequence of nodes that merges the two supplied sequences.
@param first the first sequence; may be null
@param second the second sequence; may be null
@param totalWidth the total width of the sequences; should be equal to <code>first.getWidth() + second.getWidth()</code>
@return the new merged sequence; never ... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"merges",
"the",
"two",
"supplied",
"sequences",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1184-L1301 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.initialize | public synchronized final void initialize() throws RepositoryException {
if (!initialized) {
try {
doInitialize();
initialized = true;
} catch (RuntimeException e) {
throw new RepositoryException(e);
}
}
} | java | public synchronized final void initialize() throws RepositoryException {
if (!initialized) {
try {
doInitialize();
initialized = true;
} catch (RuntimeException e) {
throw new RepositoryException(e);
}
}
} | [
"public",
"synchronized",
"final",
"void",
"initialize",
"(",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"!",
"initialized",
")",
"{",
"try",
"{",
"doInitialize",
"(",
")",
";",
"initialized",
"=",
"true",
";",
"}",
"catch",
"(",
"RuntimeException... | Initialize the provider. This is called automatically by ModeShape once for each provider instance, and should not be
called by the provider itself.
@throws RepositoryException if there is a problem initializing the provider | [
"Initialize",
"the",
"provider",
".",
"This",
"is",
"called",
"automatically",
"by",
"ModeShape",
"once",
"for",
"each",
"provider",
"instance",
"and",
"should",
"not",
"be",
"called",
"by",
"the",
"provider",
"itself",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L301-L310 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.shutdown | public synchronized final void shutdown() throws RepositoryException {
preShutdown();
delegateWriter = NoOpQueryIndexWriter.INSTANCE;
try {
// Shutdown each of the provided indexes ...
for (Map<String, AtomicIndex> byWorkspaceName : providedIndexesByWorkspaceNameByIndexN... | java | public synchronized final void shutdown() throws RepositoryException {
preShutdown();
delegateWriter = NoOpQueryIndexWriter.INSTANCE;
try {
// Shutdown each of the provided indexes ...
for (Map<String, AtomicIndex> byWorkspaceName : providedIndexesByWorkspaceNameByIndexN... | [
"public",
"synchronized",
"final",
"void",
"shutdown",
"(",
")",
"throws",
"RepositoryException",
"{",
"preShutdown",
"(",
")",
";",
"delegateWriter",
"=",
"NoOpQueryIndexWriter",
".",
"INSTANCE",
";",
"try",
"{",
"// Shutdown each of the provided indexes ...",
"for",
... | Signal this provider that it is no longer needed and can release any resources that are being held.
@throws RepositoryException if there is a problem shutting down the provider | [
"Signal",
"this",
"provider",
"that",
"it",
"is",
"no",
"longer",
"needed",
"and",
"can",
"release",
"any",
"resources",
"that",
"are",
"being",
"held",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L348-L364 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.validateDefaultColumnTypes | public void validateDefaultColumnTypes( ExecutionContext context,
IndexDefinition defn,
Problems problems ) {
assert defn != null;
for (int i = 0; i < defn.size(); i++) {
validateDefaultColumnDefinitionTy... | java | public void validateDefaultColumnTypes( ExecutionContext context,
IndexDefinition defn,
Problems problems ) {
assert defn != null;
for (int i = 0; i < defn.size(); i++) {
validateDefaultColumnDefinitionTy... | [
"public",
"void",
"validateDefaultColumnTypes",
"(",
"ExecutionContext",
"context",
",",
"IndexDefinition",
"defn",
",",
"Problems",
"problems",
")",
"{",
"assert",
"defn",
"!=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"defn",
".",
"s... | Validates that if certain default columns are present in the index definition, they have a required type.
@param context the execution context in which to perform the validation; never null
@param defn the proposed index definition; never null
@param problems the component to record any problems, errors, or warnings; ... | [
"Validates",
"that",
"if",
"certain",
"default",
"columns",
"are",
"present",
"in",
"the",
"index",
"definition",
"they",
"have",
"a",
"required",
"type",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L434-L441 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.getIndex | 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 = provi... | java | 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 = provi... | [
"public",
"final",
"Index",
"getIndex",
"(",
"String",
"indexName",
",",
"String",
"workspaceName",
")",
"{",
"logger",
"(",
")",
".",
"trace",
"(",
"\"Looking for index '{0}' in '{1}' provider for query in workspace '{2}'\"",
",",
"indexName",
",",
"getName",
"(",
")... | Get the queryable index with the given name and applicable for the given workspace.
@param indexName the name of the index in this provider; never null
@param workspaceName the name of the workspace; never null
@return the queryable index, or null if there is no such index | [
"Get",
"the",
"queryable",
"index",
"with",
"the",
"given",
"name",
"and",
"applicable",
"for",
"the",
"given",
"workspace",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L525-L531 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.getManagedIndex | 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... | java | 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... | [
"public",
"final",
"ManagedIndex",
"getManagedIndex",
"(",
"String",
"indexName",
",",
"String",
"workspaceName",
")",
"{",
"logger",
"(",
")",
".",
"trace",
"(",
"\"Looking for managed index '{0}' in '{1}' provider in workspace '{2}'\"",
",",
"indexName",
",",
"getName",... | Get the managed index with the given name and applicable for the given workspace.
@param indexName the name of the index in this provider; never null
@param workspaceName the name of the workspace; never null
@return the managed index, or null if there is no such index | [
"Get",
"the",
"managed",
"index",
"with",
"the",
"given",
"name",
"and",
"applicable",
"for",
"the",
"given",
"workspace",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L540-L550 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.onEachIndex | private final void onEachIndex( ProvidedIndexOperation op ) {
for (String workspaceName : workspaceNames()) {
Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName);
if (indexes != null) {
for (AtomicIndex atomicIndex : indexes) {
assert a... | java | private final void onEachIndex( ProvidedIndexOperation op ) {
for (String workspaceName : workspaceNames()) {
Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName);
if (indexes != null) {
for (AtomicIndex atomicIndex : indexes) {
assert a... | [
"private",
"final",
"void",
"onEachIndex",
"(",
"ProvidedIndexOperation",
"op",
")",
"{",
"for",
"(",
"String",
"workspaceName",
":",
"workspaceNames",
"(",
")",
")",
"{",
"Collection",
"<",
"AtomicIndex",
">",
"indexes",
"=",
"providedIndexesFor",
"(",
"workspa... | Perform the specified operation on each of the managed indexes.
@param op the operation; may not be null | [
"Perform",
"the",
"specified",
"operation",
"on",
"each",
"of",
"the",
"managed",
"indexes",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L597-L608 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.onEachIndexInWorkspace | public final void onEachIndexInWorkspace( String workspaceName,
ManagedIndexOperation op ) {
assert workspaceName != null;
Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName);
if (indexes != null) {
for (AtomicIndex atomic... | java | public final void onEachIndexInWorkspace( String workspaceName,
ManagedIndexOperation op ) {
assert workspaceName != null;
Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName);
if (indexes != null) {
for (AtomicIndex atomic... | [
"public",
"final",
"void",
"onEachIndexInWorkspace",
"(",
"String",
"workspaceName",
",",
"ManagedIndexOperation",
"op",
")",
"{",
"assert",
"workspaceName",
"!=",
"null",
";",
"Collection",
"<",
"AtomicIndex",
">",
"indexes",
"=",
"providedIndexesFor",
"(",
"worksp... | Perform the specified operation on each of the managed indexes in the named workspace.
@param workspaceName the name of the workspace; may not be null
@param op the operation; may not be null | [
"Perform",
"the",
"specified",
"operation",
"on",
"each",
"of",
"the",
"managed",
"indexes",
"in",
"the",
"named",
"workspace",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L628-L639 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java | IndexProvider.updateIndex | protected ManagedIndex updateIndex( IndexDefinition oldDefn,
IndexDefinition updatedDefn,
ManagedIndex existingIndex,
String workspaceName,
NodeTypes.Supplier n... | java | protected ManagedIndex updateIndex( IndexDefinition oldDefn,
IndexDefinition updatedDefn,
ManagedIndex existingIndex,
String workspaceName,
NodeTypes.Supplier n... | [
"protected",
"ManagedIndex",
"updateIndex",
"(",
"IndexDefinition",
"oldDefn",
",",
"IndexDefinition",
"updatedDefn",
",",
"ManagedIndex",
"existingIndex",
",",
"String",
"workspaceName",
",",
"NodeTypes",
".",
"Supplier",
"nodeTypesSupplier",
",",
"NodeTypePredicate",
"m... | 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.
<p>
Providers may either choose to implement this ... | [
"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",
... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L1309-L1327 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/SystemContent.java | SystemContent.readAllNodeTypes | public List<NodeTypeDefinition> readAllNodeTypes() {
CachedNode nodeTypes = nodeTypesNode();
List<NodeTypeDefinition> defns = new ArrayList<NodeTypeDefinition>();
for (ChildReference ref : nodeTypes.getChildReferences(system)) {
CachedNode nodeType = system.getNode(ref);
... | java | public List<NodeTypeDefinition> readAllNodeTypes() {
CachedNode nodeTypes = nodeTypesNode();
List<NodeTypeDefinition> defns = new ArrayList<NodeTypeDefinition>();
for (ChildReference ref : nodeTypes.getChildReferences(system)) {
CachedNode nodeType = system.getNode(ref);
... | [
"public",
"List",
"<",
"NodeTypeDefinition",
">",
"readAllNodeTypes",
"(",
")",
"{",
"CachedNode",
"nodeTypes",
"=",
"nodeTypesNode",
"(",
")",
";",
"List",
"<",
"NodeTypeDefinition",
">",
"defns",
"=",
"new",
"ArrayList",
"<",
"NodeTypeDefinition",
">",
"(",
... | Read from system storage all of the node type definitions.
@return the node types as read from the system storage | [
"Read",
"from",
"system",
"storage",
"all",
"of",
"the",
"node",
"type",
"definitions",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/SystemContent.java#L788-L796 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/text/Position.java | Position.add | 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() + po... | java | 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() + po... | [
"public",
"Position",
"add",
"(",
"Position",
"position",
")",
"{",
"if",
"(",
"this",
".",
"getIndexInContent",
"(",
")",
"<",
"0",
")",
"{",
"return",
"position",
".",
"getIndexInContent",
"(",
")",
"<",
"0",
"?",
"EMPTY_CONTENT_POSITION",
":",
"position... | Return a new position that is the addition of this position and that supplied.
@param position the position to add to this object; may not be null
@return the combined position | [
"Return",
"a",
"new",
"position",
"that",
"is",
"the",
"addition",
"of",
"this",
"position",
"and",
"that",
"supplied",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/text/Position.java#L92-L106 | train |
ModeShape/modeshape | connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/ObjectId.java | ObjectId.valueOf | 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;
... | java | 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;
... | [
"public",
"static",
"ObjectId",
"valueOf",
"(",
"String",
"uuid",
")",
"{",
"int",
"p",
"=",
"uuid",
".",
"indexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"p",
"<",
"0",
")",
"{",
"return",
"new",
"ObjectId",
"(",
"Type",
".",
"OBJECT",
",",
"uuid",
... | Constructs instance of this class from its textual representation.
@param uuid the textual representation of this object.
@return object instance. | [
"Constructs",
"instance",
"of",
"this",
"class",
"from",
"its",
"textual",
"representation",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/ObjectId.java#L77-L94 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java | RepositoryConfiguration.replaceSystemPropertyVariables | protected static Document replaceSystemPropertyVariables( Document doc ) {
if (doc.isEmpty()) return doc;
Document modified = doc.withVariablesReplacedWithSystemProperties();
if (modified == doc) return doc;
// Otherwise, we changed some values. Note that the system properties can only ... | java | protected static Document replaceSystemPropertyVariables( Document doc ) {
if (doc.isEmpty()) return doc;
Document modified = doc.withVariablesReplacedWithSystemProperties();
if (modified == doc) return doc;
// Otherwise, we changed some values. Note that the system properties can only ... | [
"protected",
"static",
"Document",
"replaceSystemPropertyVariables",
"(",
"Document",
"doc",
")",
"{",
"if",
"(",
"doc",
".",
"isEmpty",
"(",
")",
")",
"return",
"doc",
";",
"Document",
"modified",
"=",
"doc",
".",
"withVariablesReplacedWithSystemProperties",
"(",... | Utility method to replace all system property variables found within the specified document.
@param doc the document; may not be null
@return the modified document if system property variables were found, or the <code>doc</code> instance if no such
variables were found | [
"Utility",
"method",
"to",
"replace",
"all",
"system",
"property",
"variables",
"found",
"within",
"the",
"specified",
"document",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L753-L762 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java | RepositoryConfiguration.read | public static RepositoryConfiguration read( String resourcePathOrJsonContentString )
throws ParsingException, FileNotFoundException {
CheckArg.isNotNull(resourcePathOrJsonContentString, "resourcePathOrJsonContentString");
InputStream stream = ResourceLookup.read(resourcePathOrJsonContentString, ... | java | public static RepositoryConfiguration read( String resourcePathOrJsonContentString )
throws ParsingException, FileNotFoundException {
CheckArg.isNotNull(resourcePathOrJsonContentString, "resourcePathOrJsonContentString");
InputStream stream = ResourceLookup.read(resourcePathOrJsonContentString, ... | [
"public",
"static",
"RepositoryConfiguration",
"read",
"(",
"String",
"resourcePathOrJsonContentString",
")",
"throws",
"ParsingException",
",",
"FileNotFoundException",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"resourcePathOrJsonContentString",
",",
"\"resourcePathOrJsonContent... | 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.
@param resourcePathOrJsonContentString the path to a file on the file system, the path to a classpath resource file or the
JSON content string; ma... | [
"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"... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L818-L839 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java | RepositoryConfiguration.getNodeTypes | 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(configuredNodeT... | java | 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(configuredNodeT... | [
"public",
"List",
"<",
"String",
">",
"getNodeTypes",
"(",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"List",
"<",
"?",
">",
"configuredNodeTypes",
"=",
"doc",
".",
"getArray",
"(",
"Fi... | Returns a list with the cnd files which should be loaded at startup.
@return a {@code non-null} string list | [
"Returns",
"a",
"list",
"with",
"the",
"cnd",
"files",
"which",
"should",
"be",
"loaded",
"at",
"startup",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L997-L1008 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java | RepositoryConfiguration.getDefaultWorkspaceName | public String getDefaultWorkspaceName() {
Document workspaces = doc.getDocument(FieldName.WORKSPACES);
if (workspaces != null) {
return workspaces.getString(FieldName.DEFAULT, Default.DEFAULT);
}
return Default.DEFAULT;
} | java | public String getDefaultWorkspaceName() {
Document workspaces = doc.getDocument(FieldName.WORKSPACES);
if (workspaces != null) {
return workspaces.getString(FieldName.DEFAULT, Default.DEFAULT);
}
return Default.DEFAULT;
} | [
"public",
"String",
"getDefaultWorkspaceName",
"(",
")",
"{",
"Document",
"workspaces",
"=",
"doc",
".",
"getDocument",
"(",
"FieldName",
".",
"WORKSPACES",
")",
";",
"if",
"(",
"workspaces",
"!=",
"null",
")",
"{",
"return",
"workspaces",
".",
"getString",
... | Get the name of the workspace that should be used for sessions where the client does not specify the name of the workspace.
@return the default workspace name; never null | [
"Get",
"the",
"name",
"of",
"the",
"workspace",
"that",
"should",
"be",
"used",
"for",
"sessions",
"where",
"the",
"client",
"does",
"not",
"specify",
"the",
"name",
"of",
"the",
"workspace",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L1299-L1305 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java | RepositoryConfiguration.getIndexProviders | public List<Component> getIndexProviders() {
Problems problems = new SimpleProblems();
List<Component> components = readComponents(doc, FieldName.INDEX_PROVIDERS, FieldName.CLASSNAME, INDEX_PROVIDER_ALIASES,
problems);
assert !problems.hasError... | java | public List<Component> getIndexProviders() {
Problems problems = new SimpleProblems();
List<Component> components = readComponents(doc, FieldName.INDEX_PROVIDERS, FieldName.CLASSNAME, INDEX_PROVIDER_ALIASES,
problems);
assert !problems.hasError... | [
"public",
"List",
"<",
"Component",
">",
"getIndexProviders",
"(",
")",
"{",
"Problems",
"problems",
"=",
"new",
"SimpleProblems",
"(",
")",
";",
"List",
"<",
"Component",
">",
"components",
"=",
"readComponents",
"(",
"doc",
",",
"FieldName",
".",
"INDEX_PR... | Get the ordered list of index providers defined in the configuration.
@return the immutable list of provider components; never null but possibly empty | [
"Get",
"the",
"ordered",
"list",
"of",
"index",
"providers",
"defined",
"in",
"the",
"configuration",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L1539-L1545 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java | RepositoryConfiguration.getDocumentOptimization | public DocumentOptimization getDocumentOptimization() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
storage = Schematic.newDocument();
}
return new DocumentOptimization(storage.getDocument(FieldName.DOCUMENT_OPTIMIZATION));
} | java | public DocumentOptimization getDocumentOptimization() {
Document storage = doc.getDocument(FieldName.STORAGE);
if (storage == null) {
storage = Schematic.newDocument();
}
return new DocumentOptimization(storage.getDocument(FieldName.DOCUMENT_OPTIMIZATION));
} | [
"public",
"DocumentOptimization",
"getDocumentOptimization",
"(",
")",
"{",
"Document",
"storage",
"=",
"doc",
".",
"getDocument",
"(",
"FieldName",
".",
"STORAGE",
")",
";",
"if",
"(",
"storage",
"==",
"null",
")",
"{",
"storage",
"=",
"Schematic",
".",
"ne... | Get the configuration for the document optimization for this repository.
@return the document optimization configuration; never null | [
"Get",
"the",
"configuration",
"for",
"the",
"document",
"optimization",
"for",
"this",
"repository",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L1940-L1946 | train |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/internal/io/BsonDataOutput.java | BsonDataOutput.writeTo | public void writeTo( WritableByteChannel channel ) throws IOException {
int numberOfBytesToWrite = size;
for (ByteBuffer buffer : buffers) {
if (buffer == null) {
// already flushed
continue;
}
int numBytesInBuffer = Math.min(numberOfBy... | java | public void writeTo( WritableByteChannel channel ) throws IOException {
int numberOfBytesToWrite = size;
for (ByteBuffer buffer : buffers) {
if (buffer == null) {
// already flushed
continue;
}
int numBytesInBuffer = Math.min(numberOfBy... | [
"public",
"void",
"writeTo",
"(",
"WritableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"int",
"numberOfBytesToWrite",
"=",
"size",
";",
"for",
"(",
"ByteBuffer",
"buffer",
":",
"buffers",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",... | Write all content to the supplied channel.
@param channel the channel to which the content is to be written.
@throws IOException if there is a problem writing to the supplied stream | [
"Write",
"all",
"content",
"to",
"the",
"supplied",
"channel",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/internal/io/BsonDataOutput.java#L441-L455 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/Upgrades.java | Upgrades.applyUpgradesSince | 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... | java | 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... | [
"public",
"final",
"int",
"applyUpgradesSince",
"(",
"int",
"lastId",
",",
"Context",
"resources",
")",
"{",
"int",
"lastUpgradeId",
"=",
"lastId",
";",
"for",
"(",
"UpgradeOperation",
"op",
":",
"operations",
")",
"{",
"if",
"(",
"op",
".",
"getId",
"(",
... | Apply any upgrades that are more recent than identified by the last upgraded identifier.
@param lastId the identifier of the last upgrade that was successfully run against the repository
@param resources the resources for the repository
@return the identifier of the last upgrade applied to the repository; may be the s... | [
"Apply",
"any",
"upgrades",
"that",
"are",
"more",
"recent",
"than",
"identified",
"by",
"the",
"last",
"upgraded",
"identifier",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/Upgrades.java#L94-L105 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ExtensionLogger.java | ExtensionLogger.getLogger | public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) {
return new ExtensionLogger(Logger.getLogger(clazz));
} | java | public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) {
return new ExtensionLogger(Logger.getLogger(clazz));
} | [
"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.
@param clazz a {@link Class} instance; never null
@return a {@link org.modeshape.jcr.api.Logger} implementation | [
"Creates",
"a",
"new",
"logger",
"instance",
"for",
"the",
"underlying",
"class",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ExtensionLogger.java#L43-L45 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java | EsIndex.createIndex | private void createIndex() {
try {
client.createIndex(name(), workspace, columns.mappings(workspace));
client.flush(name());
} catch (IOException e) {
throw new EsIndexException(e);
}
} | java | private void createIndex() {
try {
client.createIndex(name(), workspace, columns.mappings(workspace));
client.flush(name());
} catch (IOException e) {
throw new EsIndexException(e);
}
} | [
"private",
"void",
"createIndex",
"(",
")",
"{",
"try",
"{",
"client",
".",
"createIndex",
"(",
"name",
"(",
")",
",",
"workspace",
",",
"columns",
".",
"mappings",
"(",
"workspace",
")",
")",
";",
"client",
".",
"flush",
"(",
"name",
"(",
")",
")",
... | Executes create index action. | [
"Executes",
"create",
"index",
"action",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L91-L98 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java | EsIndex.find | private EsRequest find(String nodeKey) throws IOException {
return client.getDocument(name(), workspace, nodeKey);
} | java | private EsRequest find(String nodeKey) throws IOException {
return client.getDocument(name(), workspace, nodeKey);
} | [
"private",
"EsRequest",
"find",
"(",
"String",
"nodeKey",
")",
"throws",
"IOException",
"{",
"return",
"client",
".",
"getDocument",
"(",
"name",
"(",
")",
",",
"workspace",
",",
"nodeKey",
")",
";",
"}"
] | Searches indexed node's properties by node key.
@param nodeKey node key being indexed.
@return list of stored properties as json document.
@throws IOException | [
"Searches",
"indexed",
"node",
"s",
"properties",
"by",
"node",
"key",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L184-L186 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java | EsIndex.findOrCreateDoc | private EsRequest findOrCreateDoc(String nodeKey) throws IOException {
EsRequest doc = client.getDocument(name(), workspace, nodeKey);
return doc != null ? doc : new EsRequest();
} | java | private EsRequest findOrCreateDoc(String nodeKey) throws IOException {
EsRequest doc = client.getDocument(name(), workspace, nodeKey);
return doc != null ? doc : new EsRequest();
} | [
"private",
"EsRequest",
"findOrCreateDoc",
"(",
"String",
"nodeKey",
")",
"throws",
"IOException",
"{",
"EsRequest",
"doc",
"=",
"client",
".",
"getDocument",
"(",
"name",
"(",
")",
",",
"workspace",
",",
"nodeKey",
")",
";",
"return",
"doc",
"!=",
"null",
... | Searches indexed node's properties by node key or creates new empty list.
@param nodeKey node key being indexed.
@return list of stored properties as json document or empty document
if not found.
@throws IOException | [
"Searches",
"indexed",
"node",
"s",
"properties",
"by",
"node",
"key",
"or",
"creates",
"new",
"empty",
"list",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L196-L199 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java | EsIndex.putValue | 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 in... | java | 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 in... | [
"private",
"void",
"putValue",
"(",
"EsRequest",
"doc",
",",
"EsIndexColumn",
"column",
",",
"Object",
"value",
")",
"{",
"Object",
"columnValue",
"=",
"column",
".",
"columnValue",
"(",
"value",
")",
";",
"String",
"stringValue",
"=",
"column",
".",
"string... | Appends specified value for the given column and related pseudo columns
into list of properties.
@param doc list of properties in json format
@param column colum definition
@param value column's value. | [
"Appends",
"specified",
"value",
"for",
"the",
"given",
"column",
"and",
"related",
"pseudo",
"columns",
"into",
"list",
"of",
"properties",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L209-L218 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java | EsIndex.putValues | 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 ... | java | 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 ... | [
"private",
"void",
"putValues",
"(",
"EsRequest",
"doc",
",",
"EsIndexColumn",
"column",
",",
"Object",
"[",
"]",
"value",
")",
"{",
"Object",
"[",
"]",
"columnValue",
"=",
"column",
".",
"columnValues",
"(",
"value",
")",
";",
"int",
"[",
"]",
"ln",
"... | Appends specified values for the given column and related pseudo columns
into list of properties.
@param doc list of properties in json format
@param column colum definition
@param value column's value. | [
"Appends",
"specified",
"values",
"for",
"the",
"given",
"column",
"and",
"related",
"pseudo",
"columns",
"into",
"list",
"of",
"properties",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L228-L245 | train |
ModeShape/modeshape | checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java | UnusedImports.processIdent | 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()... | java | 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()... | [
"protected",
"void",
"processIdent",
"(",
"DetailAST",
"aAST",
")",
"{",
"final",
"int",
"parentType",
"=",
"aAST",
".",
"getParent",
"(",
")",
".",
"getType",
"(",
")",
";",
"if",
"(",
"(",
"(",
"parentType",
"!=",
"TokenTypes",
".",
"DOT",
")",
"&&",... | Collects references made by IDENT.
@param aAST the IDENT node to process {@link ArrayList stuff} | [
"Collects",
"references",
"made",
"by",
"IDENT",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java#L131-L137 | train |
ModeShape/modeshape | checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java | UnusedImports.processImport | private void processImport( DetailAST aAST ) {
final FullIdent name = FullIdent.createFullIdentBelow(aAST);
if ((name != null) && !name.getText().endsWith(".*")) {
imports.add(name);
}
} | java | private void processImport( DetailAST aAST ) {
final FullIdent name = FullIdent.createFullIdentBelow(aAST);
if ((name != null) && !name.getText().endsWith(".*")) {
imports.add(name);
}
} | [
"private",
"void",
"processImport",
"(",
"DetailAST",
"aAST",
")",
"{",
"final",
"FullIdent",
"name",
"=",
"FullIdent",
".",
"createFullIdentBelow",
"(",
"aAST",
")",
";",
"if",
"(",
"(",
"name",
"!=",
"null",
")",
"&&",
"!",
"name",
".",
"getText",
"(",... | Collects the details of imports.
@param aAST node containing the import details | [
"Collects",
"the",
"details",
"of",
"imports",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java#L225-L230 | train |
ModeShape/modeshape | checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java | UnusedImports.processStaticImport | private void processStaticImport( DetailAST aAST ) {
final FullIdent name = FullIdent.createFullIdent(aAST.getFirstChild().getNextSibling());
if ((name != null) && !name.getText().endsWith(".*")) {
imports.add(name);
}
} | java | private void processStaticImport( DetailAST aAST ) {
final FullIdent name = FullIdent.createFullIdent(aAST.getFirstChild().getNextSibling());
if ((name != null) && !name.getText().endsWith(".*")) {
imports.add(name);
}
} | [
"private",
"void",
"processStaticImport",
"(",
"DetailAST",
"aAST",
")",
"{",
"final",
"FullIdent",
"name",
"=",
"FullIdent",
".",
"createFullIdent",
"(",
"aAST",
".",
"getFirstChild",
"(",
")",
".",
"getNextSibling",
"(",
")",
")",
";",
"if",
"(",
"(",
"n... | Collects the details of static imports.
@param aAST node containing the static import details | [
"Collects",
"the",
"details",
"of",
"static",
"imports",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java#L237-L242 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/Privileges.java | Privileges.forName | 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);
... | java | 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);
... | [
"public",
"PrivilegeImpl",
"forName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"contains",
"(",
"\"}\"",
")",
")",
"{",
"String",
"localName",
"=",
"name",
".",
"substring",
"(",
"name",
".",
"indexOf",
"(",
"'",
"'",
")",
"+",
"1",
... | Searches privilege object for the privilege with the given name.
@param name the name of privilege to find.
@return the privilege object or null if not found. | [
"Searches",
"privilege",
"object",
"for",
"the",
"privilege",
"with",
"the",
"given",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/Privileges.java#L174-L187 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/change/RecordingChanges.java | RecordingChanges.setChangedNodes | public void setChangedNodes( Set<NodeKey> keys ) {
if (keys != null) {
this.nodeKeys = Collections.unmodifiableSet(new HashSet<NodeKey>(keys));
}
} | java | public void setChangedNodes( Set<NodeKey> keys ) {
if (keys != null) {
this.nodeKeys = Collections.unmodifiableSet(new HashSet<NodeKey>(keys));
}
} | [
"public",
"void",
"setChangedNodes",
"(",
"Set",
"<",
"NodeKey",
">",
"keys",
")",
"{",
"if",
"(",
"keys",
"!=",
"null",
")",
"{",
"this",
".",
"nodeKeys",
"=",
"Collections",
".",
"unmodifiableSet",
"(",
"new",
"HashSet",
"<",
"NodeKey",
">",
"(",
"ke... | Sets the list of node keys involved in this change set.
@param keys a Set<NodeKey>; may not be null | [
"Sets",
"the",
"list",
"of",
"node",
"keys",
"involved",
"in",
"this",
"change",
"set",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/change/RecordingChanges.java#L297-L301 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java | QueryUtil.hasWildcardCharacters | 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 (s... | java | 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 (s... | [
"public",
"static",
"boolean",
"hasWildcardCharacters",
"(",
"String",
"expression",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"expression",
")",
";",
"CharacterIterator",
"iter",
"=",
"new",
"StringCharacterIterator",
"(",
"expression",
")",
";",
"boolean",
... | Checks if the given expression has any wildcard characters
@param expression a {@code String} value, never {@code null}
@return true if the expression has wildcard characters, false otherwise | [
"Checks",
"if",
"the",
"given",
"expression",
"has",
"any",
"wildcard",
"characters"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java#L38-L51 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java | QueryUtil.toRegularExpression | public static String toRegularExpression( String likeExpression ) {
// Replace all '\x' with 'x' ...
String result = likeExpression.replaceAll("\\\\(.)", "$1");
// Escape characters used as metacharacters in regular expressions, including
// '[', '^', '\', '$', '.', '|', '+', '(', and ')... | java | public static String toRegularExpression( String likeExpression ) {
// Replace all '\x' with 'x' ...
String result = likeExpression.replaceAll("\\\\(.)", "$1");
// Escape characters used as metacharacters in regular expressions, including
// '[', '^', '\', '$', '.', '|', '+', '(', and ')... | [
"public",
"static",
"String",
"toRegularExpression",
"(",
"String",
"likeExpression",
")",
"{",
"// Replace all '\\x' with 'x' ...",
"String",
"result",
"=",
"likeExpression",
".",
"replaceAll",
"(",
"\"\\\\\\\\(.)\"",
",",
"\"$1\"",
")",
";",
"// Escape characters used a... | 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 esc... | [
"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",
"m... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java#L84-L98 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/AnonymousCredentials.java | AnonymousCredentials.getAttributeNames | public String[] getAttributeNames() {
synchronized (attributes) {
return attributes.keySet().toArray(new String[attributes.keySet().size()]);
}
} | java | public String[] getAttributeNames() {
synchronized (attributes) {
return attributes.keySet().toArray(new String[attributes.keySet().size()]);
}
} | [
"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.
@return a string array containing the names of the stored attributes | [
"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",
".... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/AnonymousCredentials.java#L142-L146 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/xpath/XPathToQueryTranslator.java | XPathToQueryTranslator.appliesToPathConstraint | 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)predicat... | java | 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)predicat... | [
"protected",
"boolean",
"appliesToPathConstraint",
"(",
"List",
"<",
"Component",
">",
"predicates",
")",
"{",
"if",
"(",
"predicates",
".",
"isEmpty",
"(",
")",
")",
"return",
"true",
";",
"if",
"(",
"predicates",
".",
"size",
"(",
")",
">",
"1",
")",
... | Determine if the predicates contain any expressions that cannot be put into a LIKE constraint on the path.
@param predicates the predicates
@return true if the supplied predicates can be handled entirely in the LIKE constraint on the path, or false if they have
to be handled as other criteria | [
"Determine",
"if",
"the",
"predicates",
"contain",
"any",
"expressions",
"that",
"cannot",
"be",
"put",
"into",
"a",
"LIKE",
"constraint",
"on",
"the",
"path",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/xpath/XPathToQueryTranslator.java#L725-L733 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/BinaryStorage.java | BinaryStorage.defaultConfig | static BinaryStorage defaultConfig() {
// By default binaries are not stored on disk
EditableDocument binaries = Schematic.newDocument();
binaries.set(RepositoryConfiguration.FieldName.TYPE, RepositoryConfiguration.FieldValue.BINARY_STORAGE_TYPE_TRANSIENT);
return new BinaryStorage(binar... | java | static BinaryStorage defaultConfig() {
// By default binaries are not stored on disk
EditableDocument binaries = Schematic.newDocument();
binaries.set(RepositoryConfiguration.FieldName.TYPE, RepositoryConfiguration.FieldValue.BINARY_STORAGE_TYPE_TRANSIENT);
return new BinaryStorage(binar... | [
"static",
"BinaryStorage",
"defaultConfig",
"(",
")",
"{",
"// By default binaries are not stored on disk",
"EditableDocument",
"binaries",
"=",
"Schematic",
".",
"newDocument",
"(",
")",
";",
"binaries",
".",
"set",
"(",
"RepositoryConfiguration",
".",
"FieldName",
"."... | Creates a default storage configuration, which will be used whenever no specific binary store is configured.
@return a {@link org.modeshape.jboss.service.BinaryStorage} instance, never {@code null} | [
"Creates",
"a",
"default",
"storage",
"configuration",
"which",
"will",
"be",
"used",
"whenever",
"no",
"specific",
"binary",
"store",
"is",
"configured",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/BinaryStorage.java#L41-L46 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/i18n/I18n.java | I18n.localize | private static void localize( final Class<?> i18nClass,
final Locale locale ) {
assert i18nClass != null;
assert locale != null;
// Create a class-to-problem map for this locale if one doesn't exist, else get the existing one.
Map<Class<?>, Set<String>> ... | java | private static void localize( final Class<?> i18nClass,
final Locale locale ) {
assert i18nClass != null;
assert locale != null;
// Create a class-to-problem map for this locale if one doesn't exist, else get the existing one.
Map<Class<?>, Set<String>> ... | [
"private",
"static",
"void",
"localize",
"(",
"final",
"Class",
"<",
"?",
">",
"i18nClass",
",",
"final",
"Locale",
"locale",
")",
"{",
"assert",
"i18nClass",
"!=",
"null",
";",
"assert",
"locale",
"!=",
"null",
";",
"// Create a class-to-problem map for this lo... | Synchronized on the supplied internalization class.
@param i18nClass The internalization class being localized
@param locale The locale to which the supplied internationalization class should be localized. | [
"Synchronized",
"on",
"the",
"supplied",
"internalization",
"class",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/i18n/I18n.java#L184-L261 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/i18n/I18n.java | I18n.text | @Override
public String text( Locale locale,
Object... arguments ) {
try {
String rawText = rawText(locale == null ? Locale.getDefault() : locale);
return StringUtil.createString(rawText, arguments);
} catch (IllegalArgumentException err) {
... | java | @Override
public String text( Locale locale,
Object... arguments ) {
try {
String rawText = rawText(locale == null ? Locale.getDefault() : locale);
return StringUtil.createString(rawText, arguments);
} catch (IllegalArgumentException err) {
... | [
"@",
"Override",
"public",
"String",
"text",
"(",
"Locale",
"locale",
",",
"Object",
"...",
"arguments",
")",
"{",
"try",
"{",
"String",
"rawText",
"=",
"rawText",
"(",
"locale",
"==",
"null",
"?",
"Locale",
".",
"getDefault",
"(",
")",
":",
"locale",
... | Get the localized text for the supplied locale, replacing the parameters in the text with those supplied.
@param locale the locale, or <code>null</code> if the {@link Locale#getDefault() current (default) locale} should be used
@param arguments the arguments for the parameter replacement; may be <code>null</code> or e... | [
"Get",
"the",
"localized",
"text",
"for",
"the",
"supplied",
"locale",
"replacing",
"the",
"parameters",
"in",
"the",
"text",
"with",
"those",
"supplied",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/i18n/I18n.java#L407-L420 | train |
ModeShape/modeshape | web/modeshape-webdav/src/main/java/org/modeshape/webdav/methods/AbstractMethod.java | AbstractMethod.getDocumentBuilder | protected DocumentBuilder getDocumentBuilder() throws ServletException {
DocumentBuilder documentBuilder = null;
DocumentBuilderFactory documentBuilderFactory = null;
try {
documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceA... | java | protected DocumentBuilder getDocumentBuilder() throws ServletException {
DocumentBuilder documentBuilder = null;
DocumentBuilderFactory documentBuilderFactory = null;
try {
documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceA... | [
"protected",
"DocumentBuilder",
"getDocumentBuilder",
"(",
")",
"throws",
"ServletException",
"{",
"DocumentBuilder",
"documentBuilder",
"=",
"null",
";",
"DocumentBuilderFactory",
"documentBuilderFactory",
"=",
"null",
";",
"try",
"{",
"documentBuilderFactory",
"=",
"Doc... | Return JAXP document builder instance.
@return the builder
@throws ServletException | [
"Return",
"JAXP",
"document",
"builder",
"instance",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-webdav/src/main/java/org/modeshape/webdav/methods/AbstractMethod.java#L191-L202 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexUsage.java | IndexUsage.indexAppliesTo | public boolean indexAppliesTo( JoinCondition condition ) {
if (condition instanceof ChildNodeJoinCondition) {
return indexAppliesTo((ChildNodeJoinCondition)condition);
}
if (condition instanceof DescendantNodeJoinCondition) {
return indexAppliesTo((DescendantNodeJoinCondi... | java | public boolean indexAppliesTo( JoinCondition condition ) {
if (condition instanceof ChildNodeJoinCondition) {
return indexAppliesTo((ChildNodeJoinCondition)condition);
}
if (condition instanceof DescendantNodeJoinCondition) {
return indexAppliesTo((DescendantNodeJoinCondi... | [
"public",
"boolean",
"indexAppliesTo",
"(",
"JoinCondition",
"condition",
")",
"{",
"if",
"(",
"condition",
"instanceof",
"ChildNodeJoinCondition",
")",
"{",
"return",
"indexAppliesTo",
"(",
"(",
"ChildNodeJoinCondition",
")",
"condition",
")",
";",
"}",
"if",
"("... | Determine if this index can be used to evaluate the given join condition.
@param condition the condition; may not be null
@return true if it can be used to evaluate the join condition, or false otherwise | [
"Determine",
"if",
"this",
"index",
"can",
"be",
"used",
"to",
"evaluate",
"the",
"given",
"join",
"condition",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexUsage.java#L87-L101 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexUsage.java | IndexUsage.indexAppliesTo | 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) {
... | java | 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) {
... | [
"public",
"boolean",
"indexAppliesTo",
"(",
"Constraint",
"constraint",
")",
"{",
"if",
"(",
"constraint",
"instanceof",
"Comparison",
")",
"{",
"return",
"indexAppliesTo",
"(",
"(",
"Comparison",
")",
"constraint",
")",
";",
"}",
"if",
"(",
"constraint",
"ins... | Determine if this index can be used to evaluate the given constraint.
@param constraint the constraint; may not be null
@return true if it can be used to evaluate the constraint, or false otherwise | [
"Determine",
"if",
"this",
"index",
"can",
"be",
"used",
"to",
"evaluate",
"the",
"given",
"constraint",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexUsage.java#L133-L162 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/PrivilegeImpl.java | PrivilegeImpl.aggregate | private void aggregate(ArrayList<Privilege> list, Privilege p) {
list.add(p);
if (p.isAggregate()) {
for (Privilege ap : p.getDeclaredAggregatePrivileges()) {
aggregate(list, ap);
}
}
} | java | private void aggregate(ArrayList<Privilege> list, Privilege p) {
list.add(p);
if (p.isAggregate()) {
for (Privilege ap : p.getDeclaredAggregatePrivileges()) {
aggregate(list, ap);
}
}
} | [
"private",
"void",
"aggregate",
"(",
"ArrayList",
"<",
"Privilege",
">",
"list",
",",
"Privilege",
"p",
")",
"{",
"list",
".",
"add",
"(",
"p",
")",
";",
"if",
"(",
"p",
".",
"isAggregate",
"(",
")",
")",
"{",
"for",
"(",
"Privilege",
"ap",
":",
... | Recursively aggregates privileges for the given privilege.
@param list list which holds all aggregate privileges.
@param p the given privilege | [
"Recursively",
"aggregates",
"privileges",
"for",
"the",
"given",
"privilege",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/PrivilegeImpl.java#L125-L132 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/PrivilegeImpl.java | PrivilegeImpl.contains | 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())) {
... | java | 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())) {
... | [
"public",
"boolean",
"contains",
"(",
"Privilege",
"p",
")",
"{",
"if",
"(",
"p",
".",
"getName",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"this",
".",
"getName",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"Privilege",
"[",
"]",
"list",
"=... | Tests given privilege.
@param p the given privilege.
@return true if this privilege equals or aggregates given privilege. | [
"Tests",
"given",
"privilege",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/PrivilegeImpl.java#L141-L154 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java | JcrSession.save | void save( AbstractJcrNode node ) throws RepositoryException {
// first check the node is valid from a cache perspective
Set<NodeKey> keysToBeSaved = null;
try {
if (node.isNew()) {
// expected by TCK
throw new RepositoryException(JcrI18n.unableToSaveN... | java | void save( AbstractJcrNode node ) throws RepositoryException {
// first check the node is valid from a cache perspective
Set<NodeKey> keysToBeSaved = null;
try {
if (node.isNew()) {
// expected by TCK
throw new RepositoryException(JcrI18n.unableToSaveN... | [
"void",
"save",
"(",
"AbstractJcrNode",
"node",
")",
"throws",
"RepositoryException",
"{",
"// first check the node is valid from a cache perspective",
"Set",
"<",
"NodeKey",
">",
"keysToBeSaved",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"node",
".",
"isNew",
"(",
... | Save a subset of the changes made within this session.
@param node the node at or below which the changes are to be saved; may not be null
@throws RepositoryException if there is a problem saving the changes
@see AbstractJcrNode#save() | [
"Save",
"a",
"subset",
"of",
"the",
"changes",
"made",
"within",
"this",
"session",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java#L1231-L1293 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java | JcrSession.hasRole | static boolean hasRole( SecurityContext context,
String roleName,
String repositoryName,
String workspaceName ) {
if (context.hasRole(roleName)) return true;
roleName = roleName + "." + repositoryName;
if (contex... | java | static boolean hasRole( SecurityContext context,
String roleName,
String repositoryName,
String workspaceName ) {
if (context.hasRole(roleName)) return true;
roleName = roleName + "." + repositoryName;
if (contex... | [
"static",
"boolean",
"hasRole",
"(",
"SecurityContext",
"context",
",",
"String",
"roleName",
",",
"String",
"repositoryName",
",",
"String",
"workspaceName",
")",
"{",
"if",
"(",
"context",
".",
"hasRole",
"(",
"roleName",
")",
")",
"return",
"true",
";",
"... | Returns whether the authenticated user has the given role.
@param context the security context
@param roleName the name of the role to check
@param repositoryName the name of the repository
@param workspaceName the workspace under which the user must have the role. This may be different from the current
workspace.
@re... | [
"Returns",
"whether",
"the",
"authenticated",
"user",
"has",
"the",
"given",
"role",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java#L1503-L1512 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java | JcrSession.isForeignKey | public static boolean isForeignKey( NodeKey key,
NodeKey rootKey ) {
if (key == null) {
return false;
}
String nodeWorkspaceKey = key.getWorkspaceKey();
boolean sameWorkspace = rootKey.getWorkspaceKey().equals(nodeWorkspaceKey);
... | java | public static boolean isForeignKey( NodeKey key,
NodeKey rootKey ) {
if (key == null) {
return false;
}
String nodeWorkspaceKey = key.getWorkspaceKey();
boolean sameWorkspace = rootKey.getWorkspaceKey().equals(nodeWorkspaceKey);
... | [
"public",
"static",
"boolean",
"isForeignKey",
"(",
"NodeKey",
"key",
",",
"NodeKey",
"rootKey",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"nodeWorkspaceKey",
"=",
"key",
".",
"getWorkspaceKey",
"(",
")",
... | 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.
@param key the node key; may be null
@param rootKey the key of the root node in the workspace; may not be null
@return true if the node key is... | [
"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",
"ref... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java#L1982-L1992 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java | JcrSession.nodeIdentifier | public static String nodeIdentifier( NodeKey key,
NodeKey rootKey ) {
return isForeignKey(key, rootKey) ? key.toString() : key.getIdentifier();
} | java | public static String nodeIdentifier( NodeKey key,
NodeKey rootKey ) {
return isForeignKey(key, rootKey) ? key.toString() : key.getIdentifier();
} | [
"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.
@param key the node key; may be null
@param rootKey the key of the root node in the workspace; may not be null
@return the identifier for the node; never null
@see javax.jcr.Node#getIdentifier() | [
"Returns",
"a",
"string",
"representing",
"a",
"node",
"s",
"identifier",
"based",
"on",
"whether",
"the",
"node",
"is",
"foreign",
"or",
"not",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSession.java#L2002-L2005 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/DdlTokenStream.java | DdlTokenStream.computeNextStatementStartKeywordCount | public int computeNextStatementStartKeywordCount() {
int result = 0;
if (isNextKeyWord()) {
for (String[] nextStmtStart : registeredStatementStartPhrases) {
if (this.matches(nextStmtStart)) {
return nextStmtStart.length;
}
}
... | java | public int computeNextStatementStartKeywordCount() {
int result = 0;
if (isNextKeyWord()) {
for (String[] nextStmtStart : registeredStatementStartPhrases) {
if (this.matches(nextStmtStart)) {
return nextStmtStart.length;
}
}
... | [
"public",
"int",
"computeNextStatementStartKeywordCount",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"isNextKeyWord",
"(",
")",
")",
"{",
"for",
"(",
"String",
"[",
"]",
"nextStmtStart",
":",
"registeredStatementStartPhrases",
")",
"{",
"if",
... | Method to determine if next tokens match a registered statement start phrase.
@return number of keywords in matched registered statement start phrase or zero if not matched | [
"Method",
"to",
"determine",
"if",
"next",
"tokens",
"match",
"a",
"registered",
"statement",
"start",
"phrase",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/DdlTokenStream.java#L189-L201 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parse | protected void parse( String content ) {
Tokenizer tokenizer = new CndTokenizer(false, true);
TokenStream tokens = new TokenStream(content, tokenizer, false);
tokens.start();
while (tokens.hasNext()) {
// Keep reading while we can recognize one of the two types of statements ... | java | protected void parse( String content ) {
Tokenizer tokenizer = new CndTokenizer(false, true);
TokenStream tokens = new TokenStream(content, tokenizer, false);
tokens.start();
while (tokens.hasNext()) {
// Keep reading while we can recognize one of the two types of statements ... | [
"protected",
"void",
"parse",
"(",
"String",
"content",
")",
"{",
"Tokenizer",
"tokenizer",
"=",
"new",
"CndTokenizer",
"(",
"false",
",",
"true",
")",
";",
"TokenStream",
"tokens",
"=",
"new",
"TokenStream",
"(",
"content",
",",
"tokenizer",
",",
"false",
... | Parse the CND content.
@param content the content
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"CND",
"content",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L196-L213 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseNamespaceMapping | protected void parseNamespaceMapping( TokenStream tokens ) {
tokens.consume('<');
String prefix = removeQuotes(tokens.consume());
tokens.consume('=');
String uri = removeQuotes(tokens.consume());
tokens.consume('>');
// Register the namespace ...
context.getNamesp... | java | protected void parseNamespaceMapping( TokenStream tokens ) {
tokens.consume('<');
String prefix = removeQuotes(tokens.consume());
tokens.consume('=');
String uri = removeQuotes(tokens.consume());
tokens.consume('>');
// Register the namespace ...
context.getNamesp... | [
"protected",
"void",
"parseNamespaceMapping",
"(",
"TokenStream",
"tokens",
")",
"{",
"tokens",
".",
"consume",
"(",
"'",
"'",
")",
";",
"String",
"prefix",
"=",
"removeQuotes",
"(",
"tokens",
".",
"consume",
"(",
")",
")",
";",
"tokens",
".",
"consume",
... | Parse the namespace mapping statement that is next on the token stream.
@param tokens the tokens containing the namespace statement; never null
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"namespace",
"mapping",
"statement",
"that",
"is",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L221-L229 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseNodeTypeDefinition | protected void parseNodeTypeDefinition( TokenStream tokens ) {
// Parse the name, and create the path and a property for the name ...
Name name = parseNodeTypeName(tokens);
JcrNodeTypeTemplate nodeType = new JcrNodeTypeTemplate(context);
try {
nodeType.setName(string(name));
... | java | protected void parseNodeTypeDefinition( TokenStream tokens ) {
// Parse the name, and create the path and a property for the name ...
Name name = parseNodeTypeName(tokens);
JcrNodeTypeTemplate nodeType = new JcrNodeTypeTemplate(context);
try {
nodeType.setName(string(name));
... | [
"protected",
"void",
"parseNodeTypeDefinition",
"(",
"TokenStream",
"tokens",
")",
"{",
"// Parse the name, and create the path and a property for the name ...",
"Name",
"name",
"=",
"parseNodeTypeName",
"(",
"tokens",
")",
";",
"JcrNodeTypeTemplate",
"nodeType",
"=",
"new",
... | Parse the node type definition that is next on the token stream.
@param tokens the tokens containing the node type definition; never null
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"node",
"type",
"definition",
"that",
"is",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L237-L262 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseNodeTypeName | protected Name parseNodeTypeName( TokenStream tokens ) {
tokens.consume('[');
Name name = parseName(tokens);
tokens.consume(']');
return name;
} | java | protected Name parseNodeTypeName( TokenStream tokens ) {
tokens.consume('[');
Name name = parseName(tokens);
tokens.consume(']');
return name;
} | [
"protected",
"Name",
"parseNodeTypeName",
"(",
"TokenStream",
"tokens",
")",
"{",
"tokens",
".",
"consume",
"(",
"'",
"'",
")",
";",
"Name",
"name",
"=",
"parseName",
"(",
"tokens",
")",
";",
"tokens",
".",
"consume",
"(",
"'",
"'",
")",
";",
"return",... | Parse a node type name that appears next on the token stream.
@param tokens the tokens containing the node type name; never null
@return the node type name
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"a",
"node",
"type",
"name",
"that",
"appears",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L271-L276 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseSupertypes | protected List<Name> parseSupertypes( TokenStream tokens ) {
if (tokens.canConsume('>')) {
// There is at least one supertype ...
return parseNameList(tokens);
}
return Collections.emptyList();
} | java | protected List<Name> parseSupertypes( TokenStream tokens ) {
if (tokens.canConsume('>')) {
// There is at least one supertype ...
return parseNameList(tokens);
}
return Collections.emptyList();
} | [
"protected",
"List",
"<",
"Name",
">",
"parseSupertypes",
"(",
"TokenStream",
"tokens",
")",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"// There is at least one supertype ...",
"return",
"parseNameList",
"(",
"tokens",
")",
";"... | Parse an optional list of supertypes if they appear next on the token stream.
@param tokens the tokens containing the supertype names; never null
@return the list of supertype names; never null, but possibly empty
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"an",
"optional",
"list",
"of",
"supertypes",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L285-L291 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseStringList | protected List<String> parseStringList( TokenStream tokens ) {
List<String> strings = new ArrayList<String>();
if (tokens.canConsume('?')) {
// This list is variant ...
strings.add("?");
} else {
// Read names until we see a ','
do {
... | java | protected List<String> parseStringList( TokenStream tokens ) {
List<String> strings = new ArrayList<String>();
if (tokens.canConsume('?')) {
// This list is variant ...
strings.add("?");
} else {
// Read names until we see a ','
do {
... | [
"protected",
"List",
"<",
"String",
">",
"parseStringList",
"(",
"TokenStream",
"tokens",
")",
"{",
"List",
"<",
"String",
">",
"strings",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'"... | Parse a list of strings, separated by commas. Any quotes surrounding the strings are removed.
@param tokens the tokens containing the comma-separated strings; never null
@return the list of string values; never null, but possibly empty
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"a",
"list",
"of",
"strings",
"separated",
"by",
"commas",
".",
"Any",
"quotes",
"surrounding",
"the",
"strings",
"are",
"removed",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L300-L312 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseNameList | protected List<Name> parseNameList( TokenStream tokens ) {
List<Name> names = new ArrayList<Name>();
if (!tokens.canConsume('?')) {
// Read names until we see a ','
do {
names.add(parseName(tokens));
} while (tokens.canConsume(','));
}
... | java | protected List<Name> parseNameList( TokenStream tokens ) {
List<Name> names = new ArrayList<Name>();
if (!tokens.canConsume('?')) {
// Read names until we see a ','
do {
names.add(parseName(tokens));
} while (tokens.canConsume(','));
}
... | [
"protected",
"List",
"<",
"Name",
">",
"parseNameList",
"(",
"TokenStream",
"tokens",
")",
"{",
"List",
"<",
"Name",
">",
"names",
"=",
"new",
"ArrayList",
"<",
"Name",
">",
"(",
")",
";",
"if",
"(",
"!",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
... | Parse a list of names, separated by commas. Any quotes surrounding the names are removed.
@param tokens the tokens containing the comma-separated strings; never null
@return the list of string values; never null, but possibly empty
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"a",
"list",
"of",
"names",
"separated",
"by",
"commas",
".",
"Any",
"quotes",
"surrounding",
"the",
"names",
"are",
"removed",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L321-L330 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parsePropertyOrChildNodeDefinitions | protected void parsePropertyOrChildNodeDefinitions( TokenStream tokens,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
while (true) {
// Keep reading while we see a property definition or child node definition ...
... | java | protected void parsePropertyOrChildNodeDefinitions( TokenStream tokens,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
while (true) {
// Keep reading while we see a property definition or child node definition ...
... | [
"protected",
"void",
"parsePropertyOrChildNodeDefinitions",
"(",
"TokenStream",
"tokens",
",",
"JcrNodeTypeTemplate",
"nodeType",
")",
"throws",
"ConstraintViolationException",
"{",
"while",
"(",
"true",
")",
"{",
"// Keep reading while we see a property definition or child node ... | Parse a node type's property or child node definitions that appear next on the token stream.
@param tokens the tokens containing the definitions; never null
@param nodeType the node type being created; never null
@throws ParsingException if there is a problem parsing the content
@throws ConstraintViolationException no... | [
"Parse",
"a",
"node",
"type",
"s",
"property",
"or",
"child",
"node",
"definitions",
"that",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L396-L409 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parsePropertyDefinition | protected void parsePropertyDefinition( TokenStream tokens,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
tokens.consume('-');
Name name = parseName(tokens);
JcrPropertyDefinitionTemplate propDefn = new JcrPropertyDefinitionTempl... | java | protected void parsePropertyDefinition( TokenStream tokens,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
tokens.consume('-');
Name name = parseName(tokens);
JcrPropertyDefinitionTemplate propDefn = new JcrPropertyDefinitionTempl... | [
"protected",
"void",
"parsePropertyDefinition",
"(",
"TokenStream",
"tokens",
",",
"JcrNodeTypeTemplate",
"nodeType",
")",
"throws",
"ConstraintViolationException",
"{",
"tokens",
".",
"consume",
"(",
"'",
"'",
")",
";",
"Name",
"name",
"=",
"parseName",
"(",
"tok... | Parse a node type's property definition from the next tokens on the stream.
@param tokens the tokens containing the definition; never null
@param nodeType the node type definition; never null
@throws ParsingException if there is a problem parsing the content
@throws ConstraintViolationException not expected | [
"Parse",
"a",
"node",
"type",
"s",
"property",
"definition",
"from",
"the",
"next",
"tokens",
"on",
"the",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L419-L444 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parsePropertyType | protected void parsePropertyType( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn,
String defaultPropertyType ) {
if (tokens.canConsume('(')) {
// Parse the (optional) property type ...
String property... | java | protected void parsePropertyType( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn,
String defaultPropertyType ) {
if (tokens.canConsume('(')) {
// Parse the (optional) property type ...
String property... | [
"protected",
"void",
"parsePropertyType",
"(",
"TokenStream",
"tokens",
",",
"JcrPropertyDefinitionTemplate",
"propDefn",
",",
"String",
"defaultPropertyType",
")",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"// Parse the (optional) p... | Parse the property type, if a valid one appears next on the token stream.
@param tokens the tokens containing the definition; never null
@param propDefn the property definition; never null
@param defaultPropertyType the default property type if none is actually found
@throws ParsingException if there is a problem pars... | [
"Parse",
"the",
"property",
"type",
"if",
"a",
"valid",
"one",
"appears",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L454-L469 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseDefaultValues | protected void parseDefaultValues( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn ) {
if (tokens.canConsume('=')) {
List<String> defaultValues = parseStringList(tokens);
if (!defaultValues.isEmpty()) {
propDefn.setDefault... | java | protected void parseDefaultValues( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn ) {
if (tokens.canConsume('=')) {
List<String> defaultValues = parseStringList(tokens);
if (!defaultValues.isEmpty()) {
propDefn.setDefault... | [
"protected",
"void",
"parseDefaultValues",
"(",
"TokenStream",
"tokens",
",",
"JcrPropertyDefinitionTemplate",
"propDefn",
")",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"List",
"<",
"String",
">",
"defaultValues",
"=",
"parseS... | Parse the property definition's default value, if they appear next on the token stream.
@param tokens the tokens containing the definition; never null
@param propDefn the property definition; never null
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"property",
"definition",
"s",
"default",
"value",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L478-L486 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseValueConstraints | protected void parseValueConstraints( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn ) {
if (tokens.canConsume('<')) {
List<String> defaultValues = parseStringList(tokens);
if (!defaultValues.isEmpty()) {
propDefn.setV... | java | protected void parseValueConstraints( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn ) {
if (tokens.canConsume('<')) {
List<String> defaultValues = parseStringList(tokens);
if (!defaultValues.isEmpty()) {
propDefn.setV... | [
"protected",
"void",
"parseValueConstraints",
"(",
"TokenStream",
"tokens",
",",
"JcrPropertyDefinitionTemplate",
"propDefn",
")",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"List",
"<",
"String",
">",
"defaultValues",
"=",
"par... | Parse the property definition's value constraints, if they appear next on the token stream.
@param tokens the tokens containing the definition; never null
@param propDefn the property definition; never null
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"property",
"definition",
"s",
"value",
"constraints",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L495-L503 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parsePropertyAttributes | protected void parsePropertyAttributes( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
boolean autoCreated = false;
boolean mandatory ... | java | protected void parsePropertyAttributes( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
boolean autoCreated = false;
boolean mandatory ... | [
"protected",
"void",
"parsePropertyAttributes",
"(",
"TokenStream",
"tokens",
",",
"JcrPropertyDefinitionTemplate",
"propDefn",
",",
"JcrNodeTypeTemplate",
"nodeType",
")",
"throws",
"ConstraintViolationException",
"{",
"boolean",
"autoCreated",
"=",
"false",
";",
"boolean"... | Parse the property definition's attributes, if they appear next on the token stream.
@param tokens the tokens containing the attributes; never null
@param propDefn the property definition; never null
@param nodeType the node type; never null
@throws ParsingException if there is a problem parsing the content
@throws Co... | [
"Parse",
"the",
"property",
"definition",
"s",
"attributes",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L514-L573 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseQueryOperators | protected void parseQueryOperators( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn ) {
if (tokens.canConsume('?')) {
return;
}
// The query operators are expected to be enclosed in a single quote, so therefore will be a single token... | java | protected void parseQueryOperators( TokenStream tokens,
JcrPropertyDefinitionTemplate propDefn ) {
if (tokens.canConsume('?')) {
return;
}
// The query operators are expected to be enclosed in a single quote, so therefore will be a single token... | [
"protected",
"void",
"parseQueryOperators",
"(",
"TokenStream",
"tokens",
",",
"JcrPropertyDefinitionTemplate",
"propDefn",
")",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"return",
";",
"}",
"// The query operators are expected to be... | Parse the property definition's query operators, if they appear next on the token stream.
@param tokens the tokens containing the definition; never null
@param propDefn the property definition; never null
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"property",
"definition",
"s",
"query",
"operators",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L582-L602 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseChildNodeDefinition | protected void parseChildNodeDefinition( TokenStream tokens,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
tokens.consume('+');
Name name = parseName(tokens);
JcrNodeDefinitionTemplate childDefn = new JcrNodeDefinitionTemplate(... | java | protected void parseChildNodeDefinition( TokenStream tokens,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
tokens.consume('+');
Name name = parseName(tokens);
JcrNodeDefinitionTemplate childDefn = new JcrNodeDefinitionTemplate(... | [
"protected",
"void",
"parseChildNodeDefinition",
"(",
"TokenStream",
"tokens",
",",
"JcrNodeTypeTemplate",
"nodeType",
")",
"throws",
"ConstraintViolationException",
"{",
"tokens",
".",
"consume",
"(",
"'",
"'",
")",
";",
"Name",
"name",
"=",
"parseName",
"(",
"to... | Parse a node type's child node definition from the next tokens on the stream.
@param tokens the tokens containing the definition; never null
@param nodeType the node type being created; never null
@throws ParsingException if there is a problem parsing the content
@throws ConstraintViolationException not expected | [
"Parse",
"a",
"node",
"type",
"s",
"child",
"node",
"definition",
"from",
"the",
"next",
"tokens",
"on",
"the",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L612-L626 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseRequiredPrimaryTypes | protected void parseRequiredPrimaryTypes( TokenStream tokens,
JcrNodeDefinitionTemplate childDefn ) throws ConstraintViolationException {
if (tokens.canConsume('(')) {
List<Name> requiredTypes = parseNameList(tokens);
if (requiredTypes.isEmpt... | java | protected void parseRequiredPrimaryTypes( TokenStream tokens,
JcrNodeDefinitionTemplate childDefn ) throws ConstraintViolationException {
if (tokens.canConsume('(')) {
List<Name> requiredTypes = parseNameList(tokens);
if (requiredTypes.isEmpt... | [
"protected",
"void",
"parseRequiredPrimaryTypes",
"(",
"TokenStream",
"tokens",
",",
"JcrNodeDefinitionTemplate",
"childDefn",
")",
"throws",
"ConstraintViolationException",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"List",
"<",
"N... | Parse the child node definition's list of required primary types, if they appear next on the token stream.
@param tokens the tokens containing the definition; never null
@param childDefn the child node definition; never null
@throws ParsingException if there is a problem parsing the content
@throws ConstraintViolation... | [
"Parse",
"the",
"child",
"node",
"definition",
"s",
"list",
"of",
"required",
"primary",
"types",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L636-L646 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseDefaultType | protected void parseDefaultType( TokenStream tokens,
JcrNodeDefinitionTemplate childDefn ) throws ConstraintViolationException {
if (tokens.canConsume('=')) {
if (!tokens.canConsume('?')) {
Name defaultType = parseName(tokens);
chi... | java | protected void parseDefaultType( TokenStream tokens,
JcrNodeDefinitionTemplate childDefn ) throws ConstraintViolationException {
if (tokens.canConsume('=')) {
if (!tokens.canConsume('?')) {
Name defaultType = parseName(tokens);
chi... | [
"protected",
"void",
"parseDefaultType",
"(",
"TokenStream",
"tokens",
",",
"JcrNodeDefinitionTemplate",
"childDefn",
")",
"throws",
"ConstraintViolationException",
"{",
"if",
"(",
"tokens",
".",
"canConsume",
"(",
"'",
"'",
")",
")",
"{",
"if",
"(",
"!",
"token... | Parse the child node definition's default type, if they appear next on the token stream.
@param tokens the tokens containing the definition; never null
@param childDefn the child node definition; never null
@throws ParsingException if there is a problem parsing the content
@throws ConstraintViolationException not expe... | [
"Parse",
"the",
"child",
"node",
"definition",
"s",
"default",
"type",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L656-L664 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseNodeAttributes | protected void parseNodeAttributes( TokenStream tokens,
JcrNodeDefinitionTemplate childDefn,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
boolean autoCreated = false;
boolean mandatory = false;
... | java | protected void parseNodeAttributes( TokenStream tokens,
JcrNodeDefinitionTemplate childDefn,
JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException {
boolean autoCreated = false;
boolean mandatory = false;
... | [
"protected",
"void",
"parseNodeAttributes",
"(",
"TokenStream",
"tokens",
",",
"JcrNodeDefinitionTemplate",
"childDefn",
",",
"JcrNodeTypeTemplate",
"nodeType",
")",
"throws",
"ConstraintViolationException",
"{",
"boolean",
"autoCreated",
"=",
"false",
";",
"boolean",
"ma... | Parse the child node definition's attributes, if they appear next on the token stream.
@param tokens the tokens containing the attributes; never null
@param childDefn the child node definition; never null
@param nodeType the node type being created; never null
@throws ParsingException if there is a problem parsing the... | [
"Parse",
"the",
"child",
"node",
"definition",
"s",
"attributes",
"if",
"they",
"appear",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L675-L728 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseName | 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.getCaus... | java | 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.getCaus... | [
"protected",
"Name",
"parseName",
"(",
"TokenStream",
"tokens",
")",
"{",
"String",
"value",
"=",
"tokens",
".",
"consume",
"(",
")",
";",
"try",
"{",
"return",
"nameFactory",
".",
"create",
"(",
"removeQuotes",
"(",
"value",
")",
")",
";",
"}",
"catch",... | Parse the name that is expected to be next on the token stream.
@param tokens the tokens containing the name; never null
@return the name; never null
@throws ParsingException if there is a problem parsing the content | [
"Parse",
"the",
"name",
"that",
"is",
"expected",
"to",
"be",
"next",
"on",
"the",
"token",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L737-L747 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseVendorExtensions | protected final void parseVendorExtensions( TokenStream tokens,
List<Property> properties ) {
while (tokens.matches(CndTokenizer.VENDOR_EXTENSION)) {
Property extension = parseVendorExtension(tokens.consume());
if (extension != null) proper... | java | protected final void parseVendorExtensions( TokenStream tokens,
List<Property> properties ) {
while (tokens.matches(CndTokenizer.VENDOR_EXTENSION)) {
Property extension = parseVendorExtension(tokens.consume());
if (extension != null) proper... | [
"protected",
"final",
"void",
"parseVendorExtensions",
"(",
"TokenStream",
"tokens",
",",
"List",
"<",
"Property",
">",
"properties",
")",
"{",
"while",
"(",
"tokens",
".",
"matches",
"(",
"CndTokenizer",
".",
"VENDOR_EXTENSION",
")",
")",
"{",
"Property",
"ex... | Parse the vendor extensions that may appear next on the tokenzied stream.
@param tokens token stream; may not be null
@param properties the list of properties to which any vendor extension properties should be added | [
"Parse",
"the",
"vendor",
"extensions",
"that",
"may",
"appear",
"next",
"on",
"the",
"tokenzied",
"stream",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L760-L766 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseVendorExtension | protected final Property parseVendorExtension( String vendorExtension ) {
if (vendorExtension == null) return null;
// Remove the curly braces ...
String extension = vendorExtension.replaceFirst("^[{]", "").replaceAll("[}]$", "");
if (extension.trim().length() == 0) return null;
... | java | protected final Property parseVendorExtension( String vendorExtension ) {
if (vendorExtension == null) return null;
// Remove the curly braces ...
String extension = vendorExtension.replaceFirst("^[{]", "").replaceAll("[}]$", "");
if (extension.trim().length() == 0) return null;
... | [
"protected",
"final",
"Property",
"parseVendorExtension",
"(",
"String",
"vendorExtension",
")",
"{",
"if",
"(",
"vendorExtension",
"==",
"null",
")",
"return",
"null",
";",
"// Remove the curly braces ...",
"String",
"extension",
"=",
"vendorExtension",
".",
"replace... | Parse the vendor extension, including the curly braces in the CND content.
@param vendorExtension the vendor extension string
@return the property representing the vendor extension, or null if the vendor extension is incomplete | [
"Parse",
"the",
"vendor",
"extension",
"including",
"the",
"curly",
"braces",
"in",
"the",
"CND",
"content",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L774-L780 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java | CndImporter.parseVendorExtensionContent | 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));
a... | java | 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));
a... | [
"protected",
"final",
"Property",
"parseVendorExtensionContent",
"(",
"String",
"vendorExtension",
")",
"{",
"Matcher",
"matcher",
"=",
"VENDOR_PATTERN",
".",
"matcher",
"(",
"vendorExtension",
")",
";",
"if",
"(",
"!",
"matcher",
".",
"find",
"(",
")",
")",
"... | Parse the content of the vendor extension excluding the curly braces in the CND content.
@param vendorExtension the vendor extension string; never null
@return the property representing the vendor extension, or null if the vendor extension is incomplete | [
"Parse",
"the",
"content",
"of",
"the",
"vendor",
"extension",
"excluding",
"the",
"curly",
"braces",
"in",
"the",
"CND",
"content",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java#L788-L798 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java | RepositoryCache.createWorkspace | public WorkspaceCache createWorkspace( String name ) {
if (!workspaceNames.contains(name)) {
if (!configuration.isCreatingWorkspacesAllowed()) {
throw new UnsupportedOperationException(JcrI18n.creatingWorkspacesIsNotAllowedInRepository.text(getName()));
}
// O... | java | public WorkspaceCache createWorkspace( String name ) {
if (!workspaceNames.contains(name)) {
if (!configuration.isCreatingWorkspacesAllowed()) {
throw new UnsupportedOperationException(JcrI18n.creatingWorkspacesIsNotAllowedInRepository.text(getName()));
}
// O... | [
"public",
"WorkspaceCache",
"createWorkspace",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"workspaceNames",
".",
"contains",
"(",
"name",
")",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"isCreatingWorkspacesAllowed",
"(",
")",
")",
"{",
"throw",
... | 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 wo... | [
"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",
... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java#L779-L808 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java | RepositoryCache.createExternalWorkspace | 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);
... | java | 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);
... | [
"public",
"WorkspaceCache",
"createExternalWorkspace",
"(",
"String",
"name",
",",
"Connectors",
"connectors",
")",
"{",
"String",
"[",
"]",
"tokens",
"=",
"name",
".",
"split",
"(",
"\":\"",
")",
";",
"String",
"sourceName",
"=",
"tokens",
"[",
"0",
"]",
... | Creates a new workspace in the repository coupled with external document
store.
@param name the name of the repository
@param connectors connectors to the external systems.
@return workspace cache for the new workspace. | [
"Creates",
"a",
"new",
"workspace",
"in",
"the",
"repository",
"coupled",
"with",
"external",
"document",
"store",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java#L891-L927 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java | RepositoryCache.createSession | public SessionCache createSession(ExecutionContext context,
String workspaceName,
boolean readOnly) {
WorkspaceCache workspaceCache = workspace(workspaceName);
if (readOnly) {
return new ReadOnlySessionCache(context, workspaceCache);
}
return new Writa... | java | public SessionCache createSession(ExecutionContext context,
String workspaceName,
boolean readOnly) {
WorkspaceCache workspaceCache = workspace(workspaceName);
if (readOnly) {
return new ReadOnlySessionCache(context, workspaceCache);
}
return new Writa... | [
"public",
"SessionCache",
"createSession",
"(",
"ExecutionContext",
"context",
",",
"String",
"workspaceName",
",",
"boolean",
"readOnly",
")",
"{",
"WorkspaceCache",
"workspaceCache",
"=",
"workspace",
"(",
"workspaceName",
")",
";",
"if",
"(",
"readOnly",
")",
"... | Create a session for the workspace with the given name, using the supplied ExecutionContext for the session.
@param context the context for the new session; may not be null
@param workspaceName the name of the workspace; may not be null
@param readOnly true if the session is to be read-only
@return the new session tha... | [
"Create",
"a",
"session",
"for",
"the",
"workspace",
"with",
"the",
"given",
"name",
"using",
"the",
"supplied",
"ExecutionContext",
"for",
"the",
"session",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/RepositoryCache.java#L938-L946 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-text/src/main/java/org/modeshape/sequencer/text/FixedWidthTextSequencer.java | FixedWidthTextSequencer.setColumnStartPositions | public void setColumnStartPositions( String commaDelimitedColumnStartPositions ) {
CheckArg.isNotNull(commaDelimitedColumnStartPositions, "commaDelimitedColumnStartPositions");
String[] stringStartPositions = commaDelimitedColumnStartPositions.split(",");
int[] columnStartPositions = new int[st... | java | public void setColumnStartPositions( String commaDelimitedColumnStartPositions ) {
CheckArg.isNotNull(commaDelimitedColumnStartPositions, "commaDelimitedColumnStartPositions");
String[] stringStartPositions = commaDelimitedColumnStartPositions.split(",");
int[] columnStartPositions = new int[st... | [
"public",
"void",
"setColumnStartPositions",
"(",
"String",
"commaDelimitedColumnStartPositions",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"commaDelimitedColumnStartPositions",
",",
"\"commaDelimitedColumnStartPositions\"",
")",
";",
"String",
"[",
"]",
"stringStartPositi... | Set the column start positions from a list of column start positions concatenated into a single, comma-delimited string.
@param commaDelimitedColumnStartPositions a list of column start positions concatenated into a single, comma-delimited
string; may not be null
@see #setColumnStartPositions(int[]) | [
"Set",
"the",
"column",
"start",
"positions",
"from",
"a",
"list",
"of",
"column",
"start",
"positions",
"concatenated",
"into",
"a",
"single",
"comma",
"-",
"delimited",
"string",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-text/src/main/java/org/modeshape/sequencer/text/FixedWidthTextSequencer.java#L70-L81 | train |
ModeShape/modeshape | web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/DefaultContentMapper.java | DefaultContentMapper.setFor | private static Set<String> setFor( String... elements ) {
Set<String> set = new HashSet<String>(elements.length);
set.addAll(Arrays.asList(elements));
return set;
} | java | private static Set<String> setFor( String... elements ) {
Set<String> set = new HashSet<String>(elements.length);
set.addAll(Arrays.asList(elements));
return set;
} | [
"private",
"static",
"Set",
"<",
"String",
">",
"setFor",
"(",
"String",
"...",
"elements",
")",
"{",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"elements",
".",
"length",
")",
";",
"set",
".",
"addAll",
"(",
... | Returns an unmodifiable set containing the elements passed in to this method
@param elements a set of elements; may not be null
@return an unmodifiable set containing all of the elements in {@code elements}; never null | [
"Returns",
"an",
"unmodifiable",
"set",
"containing",
"the",
"elements",
"passed",
"in",
"to",
"this",
"method"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/DefaultContentMapper.java#L95-L100 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changeField | public void changeField( MappedAttributeDefinition defn,
ModelNode newValue ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = repositoryName();
// Get a snapshot of the current configuration ...
... | java | public void changeField( MappedAttributeDefinition defn,
ModelNode newValue ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = repositoryName();
// Get a snapshot of the current configuration ...
... | [
"public",
"void",
"changeField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine",
"(",
")",
";",
"String",
"repositoryName",... | Immediately change and apply the specified field in the current repository configuration to the new value.
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@throws RepositoryException if there is a problem obtaining the repository configuration or applying the ch... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"field",
"in",
"the",
"current",
"repository",
"configuration",
"to",
"the",
"new",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L249-L276 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changeIndexProviderField | public void changeIndexProviderField( MappedAttributeDefinition defn,
ModelNode newValue,
String indexProviderName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String rep... | java | public void changeIndexProviderField( MappedAttributeDefinition defn,
ModelNode newValue,
String indexProviderName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String rep... | [
"public",
"void",
"changeIndexProviderField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
",",
"String",
"indexProviderName",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine... | Immediately change and apply the specified index provider field in the current repository configuration to the new value.
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@param indexProviderName the name of the index provider
@throws RepositoryException if there... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"index",
"provider",
"field",
"in",
"the",
"current",
"repository",
"configuration",
"to",
"the",
"new",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L287-L325 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changeSequencerField | public void changeSequencerField( MappedAttributeDefinition defn,
ModelNode newValue,
String sequencerName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = re... | java | public void changeSequencerField( MappedAttributeDefinition defn,
ModelNode newValue,
String sequencerName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = re... | [
"public",
"void",
"changeSequencerField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
",",
"String",
"sequencerName",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine",
"("... | Immediately change and apply the specified sequencer field in the current repository configuration to the new value.
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@param sequencerName the name of the sequencer
@throws RepositoryException if there is a problem ... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"sequencer",
"field",
"in",
"the",
"current",
"repository",
"configuration",
"to",
"the",
"new",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L385-L424 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changePersistenceField | public void changePersistenceField(MappedAttributeDefinition defn,
ModelNode newValue) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = repositoryName();
// Get a snapshot of the current c... | java | public void changePersistenceField(MappedAttributeDefinition defn,
ModelNode newValue) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = repositoryName();
// Get a snapshot of the current c... | [
"public",
"void",
"changePersistenceField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine",
"(",
")",
";",
"String",
"repos... | Immediately change and apply the specified persistence field to the repository configuration
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@throws RepositoryException if there is a problem obtaining the repository configuration or applying the change
@throws O... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"persistence",
"field",
"to",
"the",
"repository",
"configuration"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L434-L458 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changeSourceField | public void changeSourceField( MappedAttributeDefinition defn,
ModelNode newValue,
String sourceName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = repositoryName... | java | public void changeSourceField( MappedAttributeDefinition defn,
ModelNode newValue,
String sourceName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String repositoryName = repositoryName... | [
"public",
"void",
"changeSourceField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
",",
"String",
"sourceName",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine",
"(",
")... | Immediately change and apply the specified external source field in the current repository configuration to the new value.
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@param sourceName the name of the source
@throws RepositoryException if there is a problem ... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"external",
"source",
"field",
"in",
"the",
"current",
"repository",
"configuration",
"to",
"the",
"new",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L469-L498 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changeTextExtractorField | public void changeTextExtractorField( MappedAttributeDefinition defn,
ModelNode newValue,
String extractorName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String reposit... | java | public void changeTextExtractorField( MappedAttributeDefinition defn,
ModelNode newValue,
String extractorName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String reposit... | [
"public",
"void",
"changeTextExtractorField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
",",
"String",
"extractorName",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine",
... | Immediately change and apply the specified extractor field in the current repository configuration to the new value.
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@param extractorName the name of the sequencer
@throws RepositoryException if there is a problem ... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"extractor",
"field",
"in",
"the",
"current",
"repository",
"configuration",
"to",
"the",
"new",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L509-L544 | train |
ModeShape/modeshape | deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java | RepositoryService.changeAuthenticatorField | public void changeAuthenticatorField( MappedAttributeDefinition defn,
ModelNode newValue,
String authenticatorName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String rep... | java | public void changeAuthenticatorField( MappedAttributeDefinition defn,
ModelNode newValue,
String authenticatorName ) throws RepositoryException, OperationFailedException {
ModeShapeEngine engine = getEngine();
String rep... | [
"public",
"void",
"changeAuthenticatorField",
"(",
"MappedAttributeDefinition",
"defn",
",",
"ModelNode",
"newValue",
",",
"String",
"authenticatorName",
")",
"throws",
"RepositoryException",
",",
"OperationFailedException",
"{",
"ModeShapeEngine",
"engine",
"=",
"getEngine... | Immediately change and apply the specified authenticator field in the current repository configuration to the new value.
@param defn the attribute definition for the value; may not be null
@param newValue the new string value
@param authenticatorName the name of the authenticator
@throws RepositoryException if there i... | [
"Immediately",
"change",
"and",
"apply",
"the",
"specified",
"authenticator",
"field",
"in",
"the",
"current",
"repository",
"configuration",
"to",
"the",
"new",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/deploy/jbossas/modeshape-jbossas-subsystem/src/main/java/org/modeshape/jboss/service/RepositoryService.java#L555-L610 | train |
ModeShape/modeshape | web/modeshape-webdav/src/main/java/org/modeshape/webdav/locking/LockedObject.java | LockedObject.checkLocks | public boolean checkLocks( boolean exclusive,
int depth ) {
if (checkParents(exclusive) && checkChildren(exclusive, depth)) {
return true;
}
return false;
} | java | public boolean checkLocks( boolean exclusive,
int depth ) {
if (checkParents(exclusive) && checkChildren(exclusive, depth)) {
return true;
}
return false;
} | [
"public",
"boolean",
"checkLocks",
"(",
"boolean",
"exclusive",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"checkParents",
"(",
"exclusive",
")",
"&&",
"checkChildren",
"(",
"exclusive",
",",
"depth",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"... | checks if a lock of the given exclusivity can be placed, only considering children up to "depth"
@param exclusive wheather the new lock should be exclusive
@param depth the depth to which should be checked
@return true if the lock can be placed | [
"checks",
"if",
"a",
"lock",
"of",
"the",
"given",
"exclusivity",
"can",
"be",
"placed",
"only",
"considering",
"children",
"up",
"to",
"depth"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-webdav/src/main/java/org/modeshape/webdav/locking/LockedObject.java#L251-L257 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java | Predicate.and | public Predicate<T> and( final Predicate<T> other ) {
if (other == null || other == this) return this;
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return Predicate.this.test(input) && other.test(input);
}
};
} | java | public Predicate<T> and( final Predicate<T> other ) {
if (other == null || other == this) return this;
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return Predicate.this.test(input) && other.test(input);
}
};
} | [
"public",
"Predicate",
"<",
"T",
">",
"and",
"(",
"final",
"Predicate",
"<",
"T",
">",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
"||",
"other",
"==",
"this",
")",
"return",
"this",
";",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
... | Obtain a new predicate that performs the logical AND of this predicate and the supplied predicate.
@param other the other predicate
@return the composed predicate; never null | [
"Obtain",
"a",
"new",
"predicate",
"that",
"performs",
"the",
"logical",
"AND",
"of",
"this",
"predicate",
"and",
"the",
"supplied",
"predicate",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java#L37-L45 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java | Predicate.or | public Predicate<T> or( final Predicate<T> other ) {
if (other == null || other == this) return this;
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return Predicate.this.test(input) || other.test(input);
}
};
} | java | public Predicate<T> or( final Predicate<T> other ) {
if (other == null || other == this) return this;
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return Predicate.this.test(input) || other.test(input);
}
};
} | [
"public",
"Predicate",
"<",
"T",
">",
"or",
"(",
"final",
"Predicate",
"<",
"T",
">",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
"||",
"other",
"==",
"this",
")",
"return",
"this",
";",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
... | Obtain a new predicate that performs the logical OR of this predicate and the supplied predicate.
@param other the other predicate
@return the composed predicate; never null | [
"Obtain",
"a",
"new",
"predicate",
"that",
"performs",
"the",
"logical",
"OR",
"of",
"this",
"predicate",
"and",
"the",
"supplied",
"predicate",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java#L53-L61 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java | Predicate.negate | public Predicate<T> negate() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return !Predicate.this.test(input);
}
@Override
public Predicate<T> negate() {
return Predicate.this;
}
... | java | public Predicate<T> negate() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return !Predicate.this.test(input);
}
@Override
public Predicate<T> negate() {
return Predicate.this;
}
... | [
"public",
"Predicate",
"<",
"T",
">",
"negate",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"test",
"(",
"T",
"input",
")",
"{",
"return",
"!",
"Predicate",
".",
"this",
".",
"tes... | Obtain a new predicate that performs the logical NOT of this predicate.
@return the composed predicate; never null | [
"Obtain",
"a",
"new",
"predicate",
"that",
"performs",
"the",
"logical",
"NOT",
"of",
"this",
"predicate",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java#L68-L80 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java | Predicate.never | public static <T> Predicate<T> never() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return false;
}
};
} | java | public static <T> Predicate<T> never() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return false;
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"never",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"test",
"(",
"T",
"input",
")",
"{",
"return",
"false",
";",
... | Return a predicate that is never satisfied.
@return the predicate; never null | [
"Return",
"a",
"predicate",
"that",
"is",
"never",
"satisfied",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java#L87-L94 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java | Predicate.always | public static <T> Predicate<T> always() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return true;
}
};
} | java | public static <T> Predicate<T> always() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return true;
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"always",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"test",
"(",
"T",
"input",
")",
"{",
"return",
"true",
";",
... | Return a predicate that is always satisfied.
@return the predicate; never null | [
"Return",
"a",
"predicate",
"that",
"is",
"always",
"satisfied",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/function/Predicate.java#L101-L108 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.