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-common/src/main/java/org/modeshape/common/statistic/Histogram.java
Histogram.setStrategy
public void setStrategy( T minimum, T maximum ) { this.bucketingStrategy = new ExplicitBucketingStrategy(minimum, maximum); this.bucketWidth = null; }
java
public void setStrategy( T minimum, T maximum ) { this.bucketingStrategy = new ExplicitBucketingStrategy(minimum, maximum); this.bucketWidth = null; }
[ "public", "void", "setStrategy", "(", "T", "minimum", ",", "T", "maximum", ")", "{", "this", ".", "bucketingStrategy", "=", "new", "ExplicitBucketingStrategy", "(", "minimum", ",", "maximum", ")", ";", "this", ".", "bucketWidth", "=", "null", ";", "}" ]
Set the histogram to use the supplied minimum and maximum values to determine the bucket size. @param minimum @param maximum
[ "Set", "the", "histogram", "to", "use", "the", "supplied", "minimum", "and", "maximum", "values", "to", "determine", "the", "bucket", "size", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L94-L98
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java
Histogram.setSignificantFigures
public Histogram<T> setSignificantFigures( int significantFigures ) { if (significantFigures != this.significantFigures) { this.significantFigures = significantFigures; this.bucketWidth = null; this.buckets.clear(); } return this; }
java
public Histogram<T> setSignificantFigures( int significantFigures ) { if (significantFigures != this.significantFigures) { this.significantFigures = significantFigures; this.bucketWidth = null; this.buckets.clear(); } return this; }
[ "public", "Histogram", "<", "T", ">", "setSignificantFigures", "(", "int", "significantFigures", ")", "{", "if", "(", "significantFigures", "!=", "this", ".", "significantFigures", ")", "{", "this", ".", "significantFigures", "=", "significantFigures", ";", "this"...
Set the number of significant figures used in the calculation of the bucket widths. @param significantFigures the number of significant figures for the bucket widths @return this histogram, useful for method-chaining @see #DEFAULT_SIGNIFICANT_FIGURES
[ "Set", "the", "number", "of", "significant", "figures", "used", "in", "the", "calculation", "of", "the", "bucket", "widths", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L119-L126
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java
Histogram.setBucketCount
public Histogram<T> setBucketCount( int count ) { if (count != this.bucketCount) { this.bucketCount = count; this.bucketWidth = null; this.buckets.clear(); } return this; }
java
public Histogram<T> setBucketCount( int count ) { if (count != this.bucketCount) { this.bucketCount = count; this.bucketWidth = null; this.buckets.clear(); } return this; }
[ "public", "Histogram", "<", "T", ">", "setBucketCount", "(", "int", "count", ")", "{", "if", "(", "count", "!=", "this", ".", "bucketCount", ")", "{", "this", ".", "bucketCount", "=", "count", ";", "this", ".", "bucketWidth", "=", "null", ";", "this", ...
Set the number of buckets that this histogram will use. @param count the number of buckets @return this histogram, useful for method-chaining @see #DEFAULT_BUCKET_COUNT
[ "Set", "the", "number", "of", "buckets", "that", "this", "histogram", "will", "use", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L144-L151
train
ModeShape/modeshape
modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java
JcrResourceAdapter.start
@Override public synchronized void start( BootstrapContext ctx ) throws ResourceAdapterInternalException { if (engine == null) { engine = new ModeShapeEngine(); engine.start(); } }
java
@Override public synchronized void start( BootstrapContext ctx ) throws ResourceAdapterInternalException { if (engine == null) { engine = new ModeShapeEngine(); engine.start(); } }
[ "@", "Override", "public", "synchronized", "void", "start", "(", "BootstrapContext", "ctx", ")", "throws", "ResourceAdapterInternalException", "{", "if", "(", "engine", "==", "null", ")", "{", "engine", "=", "new", "ModeShapeEngine", "(", ")", ";", "engine", "...
This is called when a resource adapter instance is bootstrapped. @param ctx A bootstrap context containing references @throws ResourceAdapterInternalException indicates bootstrap failure.
[ "This", "is", "called", "when", "a", "resource", "adapter", "instance", "is", "bootstrapped", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java#L91-L97
train
ModeShape/modeshape
modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java
JcrResourceAdapter.stop
@Override public synchronized void stop() { if (engine != null) { Future<Boolean> shutdown = engine.shutdown(); final int SHUTDOWN_TIMEOUT = 30; try { LOGGER.debug("Shutting down engine to stop resource adapter"); if ( ! shutdown.get(SHUTDO...
java
@Override public synchronized void stop() { if (engine != null) { Future<Boolean> shutdown = engine.shutdown(); final int SHUTDOWN_TIMEOUT = 30; try { LOGGER.debug("Shutting down engine to stop resource adapter"); if ( ! shutdown.get(SHUTDO...
[ "@", "Override", "public", "synchronized", "void", "stop", "(", ")", "{", "if", "(", "engine", "!=", "null", ")", "{", "Future", "<", "Boolean", ">", "shutdown", "=", "engine", ".", "shutdown", "(", ")", ";", "final", "int", "SHUTDOWN_TIMEOUT", "=", "3...
This is called when a resource adapter instance is undeployed or during application server shutdown.
[ "This", "is", "called", "when", "a", "resource", "adapter", "instance", "is", "undeployed", "or", "during", "application", "server", "shutdown", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java#L102-L123
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java
BufferManager.serializerFor
public Serializer<?> serializerFor( TypeFactory<?> type ) { if (type instanceof TupleFactory) { return ((TupleFactory<?>)type).getSerializer(this); } return serializers.serializerFor(type.getType()); }
java
public Serializer<?> serializerFor( TypeFactory<?> type ) { if (type instanceof TupleFactory) { return ((TupleFactory<?>)type).getSerializer(this); } return serializers.serializerFor(type.getType()); }
[ "public", "Serializer", "<", "?", ">", "serializerFor", "(", "TypeFactory", "<", "?", ">", "type", ")", "{", "if", "(", "type", "instanceof", "TupleFactory", ")", "{", "return", "(", "(", "TupleFactory", "<", "?", ">", ")", "type", ")", ".", "getSerial...
Obtain a serializer for the given value type. @param type the type; may not be null @return the serializer
[ "Obtain", "a", "serializer", "for", "the", "given", "value", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java#L442-L447
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java
BufferManager.bTreeKeySerializerFor
public BTreeKeySerializer<?> bTreeKeySerializerFor( TypeFactory<?> type, boolean pack ) { return serializers.bTreeKeySerializerFor(type.getType(), type.getComparator(), pack); }
java
public BTreeKeySerializer<?> bTreeKeySerializerFor( TypeFactory<?> type, boolean pack ) { return serializers.bTreeKeySerializerFor(type.getType(), type.getComparator(), pack); }
[ "public", "BTreeKeySerializer", "<", "?", ">", "bTreeKeySerializerFor", "(", "TypeFactory", "<", "?", ">", "type", ",", "boolean", "pack", ")", "{", "return", "serializers", ".", "bTreeKeySerializerFor", "(", "type", ".", "getType", "(", ")", ",", "type", "....
Obtain a serializer for the given key type. @param type the type; may not be null @param pack true if the serializer can/should pack keys together when possible, or false otherwise @return the serializer
[ "Obtain", "a", "serializer", "for", "the", "given", "key", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java#L471-L474
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java
JcrNodeTypeManager.getNodeDefinition
JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getChildNodeDefinition(definitionId); }
java
JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getChildNodeDefinition(definitionId); }
[ "JcrNodeDefinition", "getNodeDefinition", "(", "NodeDefinitionId", "definitionId", ")", "{", "if", "(", "definitionId", "==", "null", ")", "return", "null", ";", "return", "nodeTypes", "(", ")", ".", "getChildNodeDefinition", "(", "definitionId", ")", ";", "}" ]
Get the node definition given the supplied identifier. @param definitionId the identifier of the node definition @return the node definition, or null if there is no such definition (or if the ID was null)
[ "Get", "the", "node", "definition", "given", "the", "supplied", "identifier", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java#L218-L221
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java
JcrNodeTypeManager.getPropertyDefinition
JcrPropertyDefinition getPropertyDefinition( PropertyDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getPropertyDefinition(definitionId); }
java
JcrPropertyDefinition getPropertyDefinition( PropertyDefinitionId definitionId ) { if (definitionId == null) return null; return nodeTypes().getPropertyDefinition(definitionId); }
[ "JcrPropertyDefinition", "getPropertyDefinition", "(", "PropertyDefinitionId", "definitionId", ")", "{", "if", "(", "definitionId", "==", "null", ")", "return", "null", ";", "return", "nodeTypes", "(", ")", ".", "getPropertyDefinition", "(", "definitionId", ")", ";"...
Get the property definition given the supplied identifier. @param definitionId the identifier of the node definition @return the property definition, or null if there is no such definition (or if the ID was null)
[ "Get", "the", "property", "definition", "given", "the", "supplied", "identifier", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java#L229-L232
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java
JcrNodeTypeManager.isDerivedFrom
public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"...
java
public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"...
[ "public", "boolean", "isDerivedFrom", "(", "String", "[", "]", "testTypeNames", ",", "String", "primaryTypeName", ",", "String", "[", "]", "mixinNames", ")", "throws", "RepositoryException", "{", "CheckArg", ".", "isNotEmpty", "(", "testTypeNames", ",", "\"testTyp...
Determine if any of the test type names are equal to or have been derived from the primary type or any of the mixins. @param testTypeNames the names of the types or mixins being tested against (never <code>null</code>) @param primaryTypeName the primary type name (never <code>null</code>) @param mixinNames the mixin n...
[ "Determine", "if", "any", "of", "the", "test", "type", "names", "are", "equal", "to", "or", "have", "been", "derived", "from", "the", "primary", "type", "or", "any", "of", "the", "mixins", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java#L719-L751
train
ModeShape/modeshape
modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/PropertyType.java
PropertyType.valueFromName
public static int valueFromName(String name) { if (name.equals(TYPENAME_SIMPLE_REFERENCE)) { return SIMPLE_REFERENCE; } return javax.jcr.PropertyType.valueFromName(name); }
java
public static int valueFromName(String name) { if (name.equals(TYPENAME_SIMPLE_REFERENCE)) { return SIMPLE_REFERENCE; } return javax.jcr.PropertyType.valueFromName(name); }
[ "public", "static", "int", "valueFromName", "(", "String", "name", ")", "{", "if", "(", "name", ".", "equals", "(", "TYPENAME_SIMPLE_REFERENCE", ")", ")", "{", "return", "SIMPLE_REFERENCE", ";", "}", "return", "javax", ".", "jcr", ".", "PropertyType", ".", ...
Returns the numeric constant value of the type with the specified name. @param name the name of the property type. @return the numeric constant value. @throws IllegalArgumentException if <code>name</code> is not a valid property type name.
[ "Returns", "the", "numeric", "constant", "value", "of", "the", "type", "with", "the", "specified", "name", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/PropertyType.java#L61-L66
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java
SessionNode.nodeInWorkspace
protected CachedNode nodeInWorkspace( AbstractSessionCache session ) { return isNew() ? null : session.getWorkspace().getNode(key); }
java
protected CachedNode nodeInWorkspace( AbstractSessionCache session ) { return isNew() ? null : session.getWorkspace().getNode(key); }
[ "protected", "CachedNode", "nodeInWorkspace", "(", "AbstractSessionCache", "session", ")", "{", "return", "isNew", "(", ")", "?", "null", ":", "session", ".", "getWorkspace", "(", ")", ".", "getNode", "(", "key", ")", ";", "}" ]
Get the CachedNode within the workspace cache. @param session the session; may not be null @return the workspace cache's node, or null if this node is new
[ "Get", "the", "CachedNode", "within", "the", "workspace", "cache", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java#L311-L313
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java
SessionNode.getSegment
protected final Segment getSegment( NodeCache cache, CachedNode parent ) { if (parent != null) { ChildReference ref = parent.getChildReferences(cache).getChild(key); if (ref == null) { // This node doesn't exist in the parent ...
java
protected final Segment getSegment( NodeCache cache, CachedNode parent ) { if (parent != null) { ChildReference ref = parent.getChildReferences(cache).getChild(key); if (ref == null) { // This node doesn't exist in the parent ...
[ "protected", "final", "Segment", "getSegment", "(", "NodeCache", "cache", ",", "CachedNode", "parent", ")", "{", "if", "(", "parent", "!=", "null", ")", "{", "ChildReference", "ref", "=", "parent", ".", "getChildReferences", "(", "cache", ")", ".", "getChild...
Get the segment for this node. @param cache the cache @param parent the parent node @return the segment @throws NodeNotFoundInParentException if the node doesn't exist in the referenced parent
[ "Get", "the", "segment", "for", "this", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java#L429-L441
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java
JcrSystemViewExporter.emitValue
private void emitValue( Value value, ContentHandler contentHandler, int propertyType, boolean skipBinary ) throws RepositoryException, SAXException { if (PropertyType.BINARY == propertyType) { startElement(contentHa...
java
private void emitValue( Value value, ContentHandler contentHandler, int propertyType, boolean skipBinary ) throws RepositoryException, SAXException { if (PropertyType.BINARY == propertyType) { startElement(contentHa...
[ "private", "void", "emitValue", "(", "Value", "value", ",", "ContentHandler", "contentHandler", ",", "int", "propertyType", ",", "boolean", "skipBinary", ")", "throws", "RepositoryException", ",", "SAXException", "{", "if", "(", "PropertyType", ".", "BINARY", "=="...
Fires the appropriate SAX events on the content handler to build the XML elements for the value. @param value the value to be exported @param contentHandler the SAX content handler for which SAX events will be invoked as the XML document is created. @param propertyType the {@link PropertyType} for the given value @par...
[ "Fires", "the", "appropriate", "SAX", "events", "on", "the", "content", "handler", "to", "build", "the", "XML", "elements", "for", "the", "value", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java#L256-L290
train
ModeShape/modeshape
web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java
ModeShapeWebdavStore.nodeFor
private Node nodeFor( ITransaction transaction, ResolvedRequest request ) throws RepositoryException { return ((JcrSessionTransaction)transaction).nodeFor(request); }
java
private Node nodeFor( ITransaction transaction, ResolvedRequest request ) throws RepositoryException { return ((JcrSessionTransaction)transaction).nodeFor(request); }
[ "private", "Node", "nodeFor", "(", "ITransaction", "transaction", ",", "ResolvedRequest", "request", ")", "throws", "RepositoryException", "{", "return", "(", "(", "JcrSessionTransaction", ")", "transaction", ")", ".", "nodeFor", "(", "request", ")", ";", "}" ]
Get the node that corresponds to the resolved request, using the supplied active transaction. @param transaction the active transaction; may not be null @param request the resolved request; may not be null and must contain a repository name and workspace name @return the node; never null @throws RepositoryException if...
[ "Get", "the", "node", "that", "corresponds", "to", "the", "resolved", "request", "using", "the", "supplied", "active", "transaction", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java#L639-L642
train
ModeShape/modeshape
web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java
ModeShapeWebdavStore.childrenFor
private String[] childrenFor( ITransaction transaction, ResolvedRequest request ) throws RepositoryException { return ((JcrSessionTransaction)transaction).childrenFor(request); }
java
private String[] childrenFor( ITransaction transaction, ResolvedRequest request ) throws RepositoryException { return ((JcrSessionTransaction)transaction).childrenFor(request); }
[ "private", "String", "[", "]", "childrenFor", "(", "ITransaction", "transaction", ",", "ResolvedRequest", "request", ")", "throws", "RepositoryException", "{", "return", "(", "(", "JcrSessionTransaction", ")", "transaction", ")", ".", "childrenFor", "(", "request", ...
Determine the names of the children given the supplied request @param transaction the active transaction; may not be null @param request the resolved request; may not be null and must contain a repository name and workspace name @return the children names, or null if there are no children @throws RepositoryException i...
[ "Determine", "the", "names", "of", "the", "children", "given", "the", "supplied", "request" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java#L665-L668
train
ModeShape/modeshape
web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestQueryResult.java
RestQueryResult.addColumn
public RestQueryResult addColumn( String name, String type ) { if (!StringUtil.isBlank(name)) { columns.put(name, type); } return this; }
java
public RestQueryResult addColumn( String name, String type ) { if (!StringUtil.isBlank(name)) { columns.put(name, type); } return this; }
[ "public", "RestQueryResult", "addColumn", "(", "String", "name", ",", "String", "type", ")", "{", "if", "(", "!", "StringUtil", ".", "isBlank", "(", "name", ")", ")", "{", "columns", ".", "put", "(", "name", ",", "type", ")", ";", "}", "return", "thi...
Adds a new column to this result. @param name a {@code non-null} string, the name of the column @param type a {@code non-null} string, the type of the column @return this instance
[ "Adds", "a", "new", "column", "to", "this", "result", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestQueryResult.java#L53-L59
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/index/local/LocalDuplicateIndex.java
LocalDuplicateIndex.create
static <T> LocalDuplicateIndex<T> create( String name, String workspaceName, DB db, Converter<T> converter, Serializer<T> valueSerialize...
java
static <T> LocalDuplicateIndex<T> create( String name, String workspaceName, DB db, Converter<T> converter, Serializer<T> valueSerialize...
[ "static", "<", "T", ">", "LocalDuplicateIndex", "<", "T", ">", "create", "(", "String", "name", ",", "String", "workspaceName", ",", "DB", "db", ",", "Converter", "<", "T", ">", "converter", ",", "Serializer", "<", "T", ">", "valueSerializer", ",", "Comp...
Create a new index that allows duplicate values across all keys. @param name the name of the index; may not be null or empty @param workspaceName the name of the workspace; may not be null @param db the database in which the index information is to be stored; may not be null @param converter the converter from {@link ...
[ "Create", "a", "new", "index", "that", "allows", "duplicate", "values", "across", "all", "keys", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/index/local/LocalDuplicateIndex.java#L51-L58
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java
Transactions.currentTransactionId
public String currentTransactionId() { try { javax.transaction.Transaction txn = txnMgr.getTransaction(); return txn != null ? txn.toString() : null; } catch (SystemException e) { return null; } }
java
public String currentTransactionId() { try { javax.transaction.Transaction txn = txnMgr.getTransaction(); return txn != null ? txn.toString() : null; } catch (SystemException e) { return null; } }
[ "public", "String", "currentTransactionId", "(", ")", "{", "try", "{", "javax", ".", "transaction", ".", "Transaction", "txn", "=", "txnMgr", ".", "getTransaction", "(", ")", ";", "return", "txn", "!=", "null", "?", "txn", ".", "toString", "(", ")", ":",...
Get a string representation of the current transaction if there already is an existing transaction. @return a string representation of the transaction if there is an existing transaction, or null if there is none
[ "Get", "a", "string", "representation", "of", "the", "current", "transaction", "if", "there", "already", "is", "an", "existing", "transaction", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L115-L122
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java
Transactions.begin
public Transaction begin() throws NotSupportedException, SystemException, RollbackException { // check if there isn't an active transaction already NestableThreadLocalTransaction localTx = LOCAL_TRANSACTION.get(); if (localTx != null) { // we have an existing local transaction so we ...
java
public Transaction begin() throws NotSupportedException, SystemException, RollbackException { // check if there isn't an active transaction already NestableThreadLocalTransaction localTx = LOCAL_TRANSACTION.get(); if (localTx != null) { // we have an existing local transaction so we ...
[ "public", "Transaction", "begin", "(", ")", "throws", "NotSupportedException", ",", "SystemException", ",", "RollbackException", "{", "// check if there isn't an active transaction already", "NestableThreadLocalTransaction", "localTx", "=", "LOCAL_TRANSACTION", ".", "get", "(",...
Starts a new transaction if one does not already exist, and associate it with the calling thread. @return the ModeShape transaction @throws NotSupportedException If the calling thread is already associated with a transaction, and nested transactions are not supported. @throws SystemException If the transaction service...
[ "Starts", "a", "new", "transaction", "if", "one", "does", "not", "already", "exist", "and", "associate", "it", "with", "the", "calling", "thread", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L141-L186
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java
Transactions.commit
public void commit() throws HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException { Transaction transaction = currentTransaction(); if (transaction == null) { throw new IllegalStateException("No active transaction"); } transaction.commit(); ...
java
public void commit() throws HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException { Transaction transaction = currentTransaction(); if (transaction == null) { throw new IllegalStateException("No active transaction"); } transaction.commit(); ...
[ "public", "void", "commit", "(", ")", "throws", "HeuristicRollbackException", ",", "RollbackException", ",", "HeuristicMixedException", ",", "SystemException", "{", "Transaction", "transaction", "=", "currentTransaction", "(", ")", ";", "if", "(", "transaction", "==",...
Commits the current transaction, if one exists. @throws IllegalStateException If the calling thread is not associated with a transaction. @throws SystemException If the transaction service fails in an unexpected way. @throws HeuristicMixedException If a heuristic decision was made and some some parts of the transactio...
[ "Commits", "the", "current", "transaction", "if", "one", "exists", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L259-L265
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java
Transactions.rollback
public void rollback() throws SystemException { Transaction transaction = currentTransaction(); if (transaction == null) { throw new IllegalStateException("No active transaction"); } transaction.rollback(); }
java
public void rollback() throws SystemException { Transaction transaction = currentTransaction(); if (transaction == null) { throw new IllegalStateException("No active transaction"); } transaction.rollback(); }
[ "public", "void", "rollback", "(", ")", "throws", "SystemException", "{", "Transaction", "transaction", "=", "currentTransaction", "(", ")", ";", "if", "(", "transaction", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"No active transacti...
Rolls back the current transaction, if one exists. @throws IllegalStateException If the calling thread is not associated with a transaction. @throws SystemException If the transaction service fails in an unexpected way.
[ "Rolls", "back", "the", "current", "transaction", "if", "one", "exists", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L273-L279
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.without
protected NodeTypes without( Collection<JcrNodeType> removedNodeTypes ) { if (removedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); nodeTypes.removeAll(removedNodeTypes); return new NodeTypes(this.context, nodeType...
java
protected NodeTypes without( Collection<JcrNodeType> removedNodeTypes ) { if (removedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); nodeTypes.removeAll(removedNodeTypes); return new NodeTypes(this.context, nodeType...
[ "protected", "NodeTypes", "without", "(", "Collection", "<", "JcrNodeType", ">", "removedNodeTypes", ")", "{", "if", "(", "removedNodeTypes", ".", "isEmpty", "(", ")", ")", "return", "this", ";", "Collection", "<", "JcrNodeType", ">", "nodeTypes", "=", "new", ...
Obtain a new version of this cache with the specified node types removed from the new cache. @param removedNodeTypes the node types that are to be removed from the resulting cache; may not be null but may be empty @return the resulting cache that contains all of the node types within this cache but without the supplie...
[ "Obtain", "a", "new", "version", "of", "this", "cache", "with", "the", "specified", "node", "types", "removed", "from", "the", "new", "cache", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L359-L364
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.with
protected NodeTypes with( Collection<JcrNodeType> addedNodeTypes ) { if (addedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); // if there are updated node types, remove them first (hashcode is based on name alone), ...
java
protected NodeTypes with( Collection<JcrNodeType> addedNodeTypes ) { if (addedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); // if there are updated node types, remove them first (hashcode is based on name alone), ...
[ "protected", "NodeTypes", "with", "(", "Collection", "<", "JcrNodeType", ">", "addedNodeTypes", ")", "{", "if", "(", "addedNodeTypes", ".", "isEmpty", "(", ")", ")", "return", "this", ";", "Collection", "<", "JcrNodeType", ">", "nodeTypes", "=", "new", "Hash...
Obtain a new version of this cache with the specified node types added to the new cache. @param addedNodeTypes the node types that are to be added to the resulting cache; may not be null but may be empty @return the resulting cache that contains all of the node types within this cache and the supplied node types; neve...
[ "Obtain", "a", "new", "version", "of", "this", "cache", "with", "the", "specified", "node", "types", "added", "to", "the", "new", "cache", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L372-L380
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.isTypeOrSubtype
public boolean isTypeOrSubtype( Name nodeTypeName, Name candidateSupertypeName ) { if (JcrNtLexicon.BASE.equals(candidateSupertypeName)) { // If the candidate is 'nt:base', then every node type is a subtype ... return true; } if (nodeTy...
java
public boolean isTypeOrSubtype( Name nodeTypeName, Name candidateSupertypeName ) { if (JcrNtLexicon.BASE.equals(candidateSupertypeName)) { // If the candidate is 'nt:base', then every node type is a subtype ... return true; } if (nodeTy...
[ "public", "boolean", "isTypeOrSubtype", "(", "Name", "nodeTypeName", ",", "Name", "candidateSupertypeName", ")", "{", "if", "(", "JcrNtLexicon", ".", "BASE", ".", "equals", "(", "candidateSupertypeName", ")", ")", "{", "// If the candidate is 'nt:base', then every node ...
Determine whether the node's given node type matches or extends the node type with the supplied name. @param nodeTypeName the name of the node type of a node; may not be null @param candidateSupertypeName the name of the potential supertype node type; may not be null @return true if the node type does extend or match ...
[ "Determine", "whether", "the", "node", "s", "given", "node", "type", "matches", "or", "extends", "the", "node", "type", "with", "the", "supplied", "name", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L441-L450
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.isTypeOrSubtype
public boolean isTypeOrSubtype( Set<Name> nodeTypeNames, Name candidateSupertypeName ) { for (Name nodeTypeName : nodeTypeNames) { if (isTypeOrSubtype(nodeTypeName, candidateSupertypeName)) return true; } return false; }
java
public boolean isTypeOrSubtype( Set<Name> nodeTypeNames, Name candidateSupertypeName ) { for (Name nodeTypeName : nodeTypeNames) { if (isTypeOrSubtype(nodeTypeName, candidateSupertypeName)) return true; } return false; }
[ "public", "boolean", "isTypeOrSubtype", "(", "Set", "<", "Name", ">", "nodeTypeNames", ",", "Name", "candidateSupertypeName", ")", "{", "for", "(", "Name", "nodeTypeName", ":", "nodeTypeNames", ")", "{", "if", "(", "isTypeOrSubtype", "(", "nodeTypeName", ",", ...
Determine whether at least one of the node's given node types matches or extends the node type with the supplied name. @param nodeTypeNames the names of the node types of a node; may not be null @param candidateSupertypeName the name of the potential supertype node type; may not be null @return true if the node type d...
[ "Determine", "whether", "at", "least", "one", "of", "the", "node", "s", "given", "node", "types", "matches", "or", "extends", "the", "node", "type", "with", "the", "supplied", "name", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L460-L466
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.allowsNameSiblings
public boolean allowsNameSiblings( Name primaryType, Set<Name> mixinTypes ) { if (isUnorderedCollection(primaryType, mixinTypes)) { // regardless of the actual types, if at least one of them is an unordered collection, SNS are not allowed return fal...
java
public boolean allowsNameSiblings( Name primaryType, Set<Name> mixinTypes ) { if (isUnorderedCollection(primaryType, mixinTypes)) { // regardless of the actual types, if at least one of them is an unordered collection, SNS are not allowed return fal...
[ "public", "boolean", "allowsNameSiblings", "(", "Name", "primaryType", ",", "Set", "<", "Name", ">", "mixinTypes", ")", "{", "if", "(", "isUnorderedCollection", "(", "primaryType", ",", "mixinTypes", ")", ")", "{", "// regardless of the actual types, if at least one o...
Determine if either the primary type or any of the mixin types allows SNS. @param primaryType the primary type name; may not be null @param mixinTypes the mixin type names; may be null or empty @return {@code true} if either the primary type or any of the mixin types allows SNS. If neither allow SNS, this will return ...
[ "Determine", "if", "either", "the", "primary", "type", "or", "any", "of", "the", "mixin", "types", "allows", "SNS", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L593-L607
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.getBucketIdLengthForUnorderedCollection
public int getBucketIdLengthForUnorderedCollection( Name nodeTypeName, Set<Name> mixinTypes ) { Set<Name> allTypes = new LinkedHashSet<>(); allTypes.add(nodeTypeName); if (mixinTypes != null && !mixinTypes.isEmpty()) { allTypes.addAll(mixinTypes); } for (Name typeName...
java
public int getBucketIdLengthForUnorderedCollection( Name nodeTypeName, Set<Name> mixinTypes ) { Set<Name> allTypes = new LinkedHashSet<>(); allTypes.add(nodeTypeName); if (mixinTypes != null && !mixinTypes.isEmpty()) { allTypes.addAll(mixinTypes); } for (Name typeName...
[ "public", "int", "getBucketIdLengthForUnorderedCollection", "(", "Name", "nodeTypeName", ",", "Set", "<", "Name", ">", "mixinTypes", ")", "{", "Set", "<", "Name", ">", "allTypes", "=", "new", "LinkedHashSet", "<>", "(", ")", ";", "allTypes", ".", "add", "(",...
Determine the length of a bucket ID for an unordered collection, based on its type and possible mixins. @param nodeTypeName the primary type of the collection; may not be null. @param mixinTypes the mixin type names; may be null or empty @return the order of magnitude, as a power of 16
[ "Determine", "the", "length", "of", "a", "bucket", "ID", "for", "an", "unordered", "collection", "based", "on", "its", "type", "and", "possible", "mixins", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L647-L665
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.isReferenceProperty
public boolean isReferenceProperty( Name nodeTypeName, Name propertyName ) { JcrNodeType type = getNodeType(nodeTypeName); if (type != null) { for (JcrPropertyDefinition propDefn : type.allPropertyDefinitions(propertyName)) { int requir...
java
public boolean isReferenceProperty( Name nodeTypeName, Name propertyName ) { JcrNodeType type = getNodeType(nodeTypeName); if (type != null) { for (JcrPropertyDefinition propDefn : type.allPropertyDefinitions(propertyName)) { int requir...
[ "public", "boolean", "isReferenceProperty", "(", "Name", "nodeTypeName", ",", "Name", "propertyName", ")", "{", "JcrNodeType", "type", "=", "getNodeType", "(", "nodeTypeName", ")", ";", "if", "(", "type", "!=", "null", ")", "{", "for", "(", "JcrPropertyDefinit...
Determine if the named property on the node type is a reference property. @param nodeTypeName the name of the node type; may not be null @param propertyName the name of the property definition; may not be null @return true if the property is a {@link PropertyType#REFERENCE}, {@link PropertyType#WEAKREFERENCE}, or {@li...
[ "Determine", "if", "the", "named", "property", "on", "the", "node", "type", "is", "a", "reference", "property", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L691-L704
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.hasMandatoryPropertyDefinitions
public boolean hasMandatoryPropertyDefinitions( Name primaryType, Set<Name> mixinTypes ) { if (mandatoryPropertiesNodeTypes.containsKey(primaryType)) return true; for (Name mixinType : mixinTypes) { if (mandatoryPropertiesNodeTypes.contains...
java
public boolean hasMandatoryPropertyDefinitions( Name primaryType, Set<Name> mixinTypes ) { if (mandatoryPropertiesNodeTypes.containsKey(primaryType)) return true; for (Name mixinType : mixinTypes) { if (mandatoryPropertiesNodeTypes.contains...
[ "public", "boolean", "hasMandatoryPropertyDefinitions", "(", "Name", "primaryType", ",", "Set", "<", "Name", ">", "mixinTypes", ")", "{", "if", "(", "mandatoryPropertiesNodeTypes", ".", "containsKey", "(", "primaryType", ")", ")", "return", "true", ";", "for", "...
Determine if the named primary node type or mixin types has at least one mandatory property definitions declared on it or any of its supertypes. @param primaryType the primary type name; may not be null @param mixinTypes the mixin type names; may not be null but may be empty @return true if any of the named node types...
[ "Determine", "if", "the", "named", "primary", "node", "type", "or", "mixin", "types", "has", "at", "least", "one", "mandatory", "property", "definitions", "declared", "on", "it", "or", "any", "of", "its", "supertypes", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L714-L721
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.hasMandatoryChildNodeDefinitions
public boolean hasMandatoryChildNodeDefinitions( Name primaryType, Set<Name> mixinTypes ) { if (mandatoryChildrenNodeTypes.containsKey(primaryType)) return true; for (Name mixinType : mixinTypes) { if (mandatoryChildrenNodeTypes.containsKe...
java
public boolean hasMandatoryChildNodeDefinitions( Name primaryType, Set<Name> mixinTypes ) { if (mandatoryChildrenNodeTypes.containsKey(primaryType)) return true; for (Name mixinType : mixinTypes) { if (mandatoryChildrenNodeTypes.containsKe...
[ "public", "boolean", "hasMandatoryChildNodeDefinitions", "(", "Name", "primaryType", ",", "Set", "<", "Name", ">", "mixinTypes", ")", "{", "if", "(", "mandatoryChildrenNodeTypes", ".", "containsKey", "(", "primaryType", ")", ")", "return", "true", ";", "for", "(...
Determine if the named primary node type or mixin types has at least one mandatory child node definitions declared on it or any of its supertypes. @param primaryType the primary type name; may not be null @param mixinTypes the mixin type names; may not be null but may be empty @return true if any of the the named node...
[ "Determine", "if", "the", "named", "primary", "node", "type", "or", "mixin", "types", "has", "at", "least", "one", "mandatory", "child", "node", "definitions", "declared", "on", "it", "or", "any", "of", "its", "supertypes", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L732-L739
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.isQueryable
public boolean isQueryable(Name nodeTypeName, Set<Name> mixinTypes) { if (nonQueryableNodeTypes.contains(nodeTypeName)) { return false; } if (!mixinTypes.isEmpty()) { for (Name mixinType : mixinTypes) { if (nonQueryableNodeTypes.contains(mixinType)) { ...
java
public boolean isQueryable(Name nodeTypeName, Set<Name> mixinTypes) { if (nonQueryableNodeTypes.contains(nodeTypeName)) { return false; } if (!mixinTypes.isEmpty()) { for (Name mixinType : mixinTypes) { if (nonQueryableNodeTypes.contains(mixinType)) { ...
[ "public", "boolean", "isQueryable", "(", "Name", "nodeTypeName", ",", "Set", "<", "Name", ">", "mixinTypes", ")", "{", "if", "(", "nonQueryableNodeTypes", ".", "contains", "(", "nodeTypeName", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "...
Check if the node type and mixin types are queryable or not. @param nodeTypeName a {@link Name}, never {@code null} @param mixinTypes the mixin type names; may not be null but may be empty @return {@code false} if at least one of the node types is not queryable, {@code true} otherwise
[ "Check", "if", "the", "node", "type", "and", "mixin", "types", "are", "queryable", "or", "not", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L885-L897
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.canRemoveItem
boolean canRemoveItem( Name primaryTypeNameOfParent, List<Name> mixinTypeNamesOfParent, Name itemName, boolean skipProtected ) { // First look in the primary type for a matching property definition... JcrNodeType primaryTyp...
java
boolean canRemoveItem( Name primaryTypeNameOfParent, List<Name> mixinTypeNamesOfParent, Name itemName, boolean skipProtected ) { // First look in the primary type for a matching property definition... JcrNodeType primaryTyp...
[ "boolean", "canRemoveItem", "(", "Name", "primaryTypeNameOfParent", ",", "List", "<", "Name", ">", "mixinTypeNamesOfParent", ",", "Name", "itemName", ",", "boolean", "skipProtected", ")", "{", "// First look in the primary type for a matching property definition...", "JcrNode...
Determine if the node and property definitions of the supplied primary type and mixin types allow the item with the supplied name to be removed. @param primaryTypeNameOfParent the name of the primary type for the parent node; may not be null @param mixinTypeNamesOfParent the names of the mixin types for the parent nod...
[ "Determine", "if", "the", "node", "and", "property", "definitions", "of", "the", "supplied", "primary", "type", "and", "mixin", "types", "allow", "the", "item", "with", "the", "supplied", "name", "to", "be", "removed", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1686-L1743
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.findTypeInMapOrList
protected JcrNodeType findTypeInMapOrList( Name typeName, Collection<JcrNodeType> pendingList ) { for (JcrNodeType pendingNodeType : pendingList) { if (pendingNodeType.getInternalName().equals(typeName)) { return pendingNodeType; ...
java
protected JcrNodeType findTypeInMapOrList( Name typeName, Collection<JcrNodeType> pendingList ) { for (JcrNodeType pendingNodeType : pendingList) { if (pendingNodeType.getInternalName().equals(typeName)) { return pendingNodeType; ...
[ "protected", "JcrNodeType", "findTypeInMapOrList", "(", "Name", "typeName", ",", "Collection", "<", "JcrNodeType", ">", "pendingList", ")", "{", "for", "(", "JcrNodeType", "pendingNodeType", ":", "pendingList", ")", "{", "if", "(", "pendingNodeType", ".", "getInte...
Finds the named type in the given collection of types pending registration if it exists, else returns the type definition from the repository @param typeName the name of the type to retrieve @param pendingList a collection of types that have passed validation but have not yet been committed to the repository @return t...
[ "Finds", "the", "named", "type", "in", "the", "given", "collection", "of", "types", "pending", "registration", "if", "it", "exists", "else", "returns", "the", "type", "definition", "from", "the", "repository" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1877-L1886
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.supertypesFor
protected List<JcrNodeType> supertypesFor( NodeTypeDefinition nodeType, Collection<JcrNodeType> pendingTypes ) throws RepositoryException { assert nodeType != null; List<JcrNodeType> supertypes = new LinkedList<JcrNodeType>(); boolean isMixin = no...
java
protected List<JcrNodeType> supertypesFor( NodeTypeDefinition nodeType, Collection<JcrNodeType> pendingTypes ) throws RepositoryException { assert nodeType != null; List<JcrNodeType> supertypes = new LinkedList<JcrNodeType>(); boolean isMixin = no...
[ "protected", "List", "<", "JcrNodeType", ">", "supertypesFor", "(", "NodeTypeDefinition", "nodeType", ",", "Collection", "<", "JcrNodeType", ">", "pendingTypes", ")", "throws", "RepositoryException", "{", "assert", "nodeType", "!=", "null", ";", "List", "<", "JcrN...
Returns the list of node types for the supertypes defined in the given node type. @param nodeType a node type with a non-null array of supertypes @param pendingTypes the list of types that have been processed in this type batch but not yet committed to the repository's set of types @return a list of node types where e...
[ "Returns", "the", "list", "of", "node", "types", "for", "the", "supertypes", "defined", "in", "the", "given", "node", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1899-L1929
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.subtypesFor
final Collection<JcrNodeType> subtypesFor( JcrNodeType nodeType ) { List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>(); for (JcrNodeType type : this.nodeTypes.values()) { if (type.supertypes().contains(nodeType)) { subtypes.add(type); } } r...
java
final Collection<JcrNodeType> subtypesFor( JcrNodeType nodeType ) { List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>(); for (JcrNodeType type : this.nodeTypes.values()) { if (type.supertypes().contains(nodeType)) { subtypes.add(type); } } r...
[ "final", "Collection", "<", "JcrNodeType", ">", "subtypesFor", "(", "JcrNodeType", "nodeType", ")", "{", "List", "<", "JcrNodeType", ">", "subtypes", "=", "new", "LinkedList", "<", "JcrNodeType", ">", "(", ")", ";", "for", "(", "JcrNodeType", "type", ":", ...
Returns the list of subtypes for the given node. @param nodeType the node type for which subtypes should be returned; may not be null @return the subtypes for the node
[ "Returns", "the", "list", "of", "subtypes", "for", "the", "given", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1937-L1945
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.declaredSubtypesFor
final Collection<JcrNodeType> declaredSubtypesFor( JcrNodeType nodeType ) { CheckArg.isNotNull(nodeType, "nodeType"); String nodeTypeName = nodeType.getName(); List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>(); for (JcrNodeType type : this.nodeTypes.values()) { if (A...
java
final Collection<JcrNodeType> declaredSubtypesFor( JcrNodeType nodeType ) { CheckArg.isNotNull(nodeType, "nodeType"); String nodeTypeName = nodeType.getName(); List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>(); for (JcrNodeType type : this.nodeTypes.values()) { if (A...
[ "final", "Collection", "<", "JcrNodeType", ">", "declaredSubtypesFor", "(", "JcrNodeType", "nodeType", ")", "{", "CheckArg", ".", "isNotNull", "(", "nodeType", ",", "\"nodeType\"", ")", ";", "String", "nodeTypeName", "=", "nodeType", ".", "getName", "(", ")", ...
Returns the list of declared subtypes for the given node. @param nodeType the node type for which declared subtypes should be returned; may not be null @return the subtypes for the node
[ "Returns", "the", "list", "of", "declared", "subtypes", "for", "the", "given", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1953-L1963
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.validate
protected void validate( JcrNodeType nodeType, List<JcrNodeType> supertypes, List<JcrNodeType> pendingTypes ) throws RepositoryException { validateSupertypes(supertypes); List<Name> supertypeNames = new ArrayList<Name>(supertypes.size()); ...
java
protected void validate( JcrNodeType nodeType, List<JcrNodeType> supertypes, List<JcrNodeType> pendingTypes ) throws RepositoryException { validateSupertypes(supertypes); List<Name> supertypeNames = new ArrayList<Name>(supertypes.size()); ...
[ "protected", "void", "validate", "(", "JcrNodeType", "nodeType", ",", "List", "<", "JcrNodeType", ">", "supertypes", ",", "List", "<", "JcrNodeType", ">", "pendingTypes", ")", "throws", "RepositoryException", "{", "validateSupertypes", "(", "supertypes", ")", ";",...
Validates that the given node type definition is valid under the ModeShape and JCR type rules within the given context. @param nodeType the node type to attempt to validate @param supertypes the names of the supertypes of the node type @param pendingTypes the list of types previously registered in this batch but not y...
[ "Validates", "that", "the", "given", "node", "type", "definition", "is", "valid", "under", "the", "ModeShape", "and", "JCR", "type", "rules", "within", "the", "given", "context", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L2038-L2092
train
ModeShape/modeshape
modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java
JcrType.isCaseSensitive
public boolean isCaseSensitive() { switch (getJcrType()) { case PropertyType.DOUBLE: case PropertyType.LONG: case PropertyType.DECIMAL: case PropertyType.WEAKREFERENCE: case PropertyType.REFERENCE: // conversion is case-insensitive case Pro...
java
public boolean isCaseSensitive() { switch (getJcrType()) { case PropertyType.DOUBLE: case PropertyType.LONG: case PropertyType.DECIMAL: case PropertyType.WEAKREFERENCE: case PropertyType.REFERENCE: // conversion is case-insensitive case Pro...
[ "public", "boolean", "isCaseSensitive", "(", ")", "{", "switch", "(", "getJcrType", "(", ")", ")", "{", "case", "PropertyType", ".", "DOUBLE", ":", "case", "PropertyType", ".", "LONG", ":", "case", "PropertyType", ".", "DECIMAL", ":", "case", "PropertyType",...
Get the indicator if the value is case sensitive @return boolean indicating if the value is case sensitive
[ "Get", "the", "indicator", "if", "the", "value", "is", "case", "sensitive" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java#L207-L218
train
ModeShape/modeshape
modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java
JcrType.isSigned
public boolean isSigned() { switch (getJcrType()) { case PropertyType.DOUBLE: case PropertyType.LONG: case PropertyType.DECIMAL: case PropertyType.DATE: return true; } return false; }
java
public boolean isSigned() { switch (getJcrType()) { case PropertyType.DOUBLE: case PropertyType.LONG: case PropertyType.DECIMAL: case PropertyType.DATE: return true; } return false; }
[ "public", "boolean", "isSigned", "(", ")", "{", "switch", "(", "getJcrType", "(", ")", ")", "{", "case", "PropertyType", ".", "DOUBLE", ":", "case", "PropertyType", ".", "LONG", ":", "case", "PropertyType", ".", "DECIMAL", ":", "case", "PropertyType", ".",...
Get the indicator if the value is considered a signed value. @return boolean indicating if value is signed.
[ "Get", "the", "indicator", "if", "the", "value", "is", "considered", "a", "signed", "value", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java#L225-L234
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java
Collections.concat
public static <T> Iterable<T> concat( final Iterable<T> a, final Iterable<T> b ) { assert (a != null); assert (b != null); return () -> Collections.concat(a.iterator(), b.iterator()); }
java
public static <T> Iterable<T> concat( final Iterable<T> a, final Iterable<T> b ) { assert (a != null); assert (b != null); return () -> Collections.concat(a.iterator(), b.iterator()); }
[ "public", "static", "<", "T", ">", "Iterable", "<", "T", ">", "concat", "(", "final", "Iterable", "<", "T", ">", "a", ",", "final", "Iterable", "<", "T", ">", "b", ")", "{", "assert", "(", "a", "!=", "null", ")", ";", "assert", "(", "b", "!=", ...
Concatenate two Iterable sources @param a a non-null Iterable value @param b a non-null Iterable value @return an Iterable that will iterate through all the values from 'a' and then all the values from 'b' @param <T> the value type
[ "Concatenate", "two", "Iterable", "sources" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java#L53-L59
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java
Collections.concat
public static <T> Iterator<T> concat( final Iterator<T> a, final Iterator<T> b ) { assert (a != null); assert (b != null); return new Iterator<T>() { @Override public boolean hasNext() { return a.hasNext() || b.h...
java
public static <T> Iterator<T> concat( final Iterator<T> a, final Iterator<T> b ) { assert (a != null); assert (b != null); return new Iterator<T>() { @Override public boolean hasNext() { return a.hasNext() || b.h...
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "concat", "(", "final", "Iterator", "<", "T", ">", "a", ",", "final", "Iterator", "<", "T", ">", "b", ")", "{", "assert", "(", "a", "!=", "null", ")", ";", "assert", "(", "b", "!=", ...
Concatenate two Iterators @param a a non-null Iterator @param b a non-null Iterator @return an Iterator that will iterate through all the values of 'a', and then all the values of 'b' @param <T> the value type
[ "Concatenate", "two", "Iterators" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java#L69-L95
train
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java
EsIndexColumns.column
public EsIndexColumn column(String name) { return columns.get(noprefix(name, EsIndexColumn.LENGTH_PREFIX, EsIndexColumn.LOWERCASE_PREFIX, EsIndexColumn.UPPERCASE_PREFIX)); }
java
public EsIndexColumn column(String name) { return columns.get(noprefix(name, EsIndexColumn.LENGTH_PREFIX, EsIndexColumn.LOWERCASE_PREFIX, EsIndexColumn.UPPERCASE_PREFIX)); }
[ "public", "EsIndexColumn", "column", "(", "String", "name", ")", "{", "return", "columns", ".", "get", "(", "noprefix", "(", "name", ",", "EsIndexColumn", ".", "LENGTH_PREFIX", ",", "EsIndexColumn", ".", "LOWERCASE_PREFIX", ",", "EsIndexColumn", ".", "UPPERCASE_...
Gets column with given name. @param name the name of column in index or name of pseudo column like lower case, upper case or length. @return real column definition related to the specified name
[ "Gets", "column", "with", "given", "name", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L78-L83
train
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java
EsIndexColumns.noprefix
private String noprefix(String name, String... prefix) { for (int i = 0; i < prefix.length; i++) { if (name.startsWith(prefix[i])) { name = name.replaceAll(prefix[i], ""); } } return name; }
java
private String noprefix(String name, String... prefix) { for (int i = 0; i < prefix.length; i++) { if (name.startsWith(prefix[i])) { name = name.replaceAll(prefix[i], ""); } } return name; }
[ "private", "String", "noprefix", "(", "String", "name", ",", "String", "...", "prefix", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "prefix", ".", "length", ";", "i", "++", ")", "{", "if", "(", "name", ".", "startsWith", "(", "pref...
Cuts name prefix for the pseudo column case. @param name the name of the column or pseudo column. @param prefix the list of prefixes to cut. @return the name without prefix.
[ "Cuts", "name", "prefix", "for", "the", "pseudo", "column", "case", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L92-L99
train
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java
EsIndexColumns.mappings
public EsRequest mappings( String type ) { EsRequest mappings = new EsRequest(); EsRequest mappingsValue = new EsRequest(); EsRequest mtype = new EsRequest(); EsRequest properties = new EsRequest(); for (EsIndexColumn col : columns()) { ...
java
public EsRequest mappings( String type ) { EsRequest mappings = new EsRequest(); EsRequest mappingsValue = new EsRequest(); EsRequest mtype = new EsRequest(); EsRequest properties = new EsRequest(); for (EsIndexColumn col : columns()) { ...
[ "public", "EsRequest", "mappings", "(", "String", "type", ")", "{", "EsRequest", "mappings", "=", "new", "EsRequest", "(", ")", ";", "EsRequest", "mappingsValue", "=", "new", "EsRequest", "(", ")", ";", "EsRequest", "mtype", "=", "new", "EsRequest", "(", "...
Provides Elasticsearch mapping definition for the given type and this columns. @param type the type name for wich this mapping will be applied. @return mappings definition in the JSON format.
[ "Provides", "Elasticsearch", "mapping", "definition", "for", "the", "given", "type", "and", "this", "columns", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L117-L133
train
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java
EsIndexColumns.fieldMapping
private EsRequest fieldMapping( PropertyType type ) { EsRequest mappings = new EsRequest(); switch (type) { case BINARY: mappings.put("type", "binary"); break; case BOOLEAN: mappings.put("type", "boolean"); break; ...
java
private EsRequest fieldMapping( PropertyType type ) { EsRequest mappings = new EsRequest(); switch (type) { case BINARY: mappings.put("type", "binary"); break; case BOOLEAN: mappings.put("type", "boolean"); break; ...
[ "private", "EsRequest", "fieldMapping", "(", "PropertyType", "type", ")", "{", "EsRequest", "mappings", "=", "new", "EsRequest", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "BINARY", ":", "mappings", ".", "put", "(", "\"type\"", ",", "\"binary\...
Creates mapping definition for the specified column type. @param type @return
[ "Creates", "mapping", "definition", "for", "the", "specified", "column", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L141-L165
train
ModeShape/modeshape
web/modeshape-web-explorer/src/main/java/org/modeshape/web/shared/ModalDialog.java
ModalDialog.setControls
public void setControls(FormItem... items) { FormItem[] controls = new FormItem[items.length + 3]; int i = 0; for (FormItem item : items) { controls[i++] = item; } controls[i++] = new SpacerItem(); controls[i++] = confirmButton; controls[i++]...
java
public void setControls(FormItem... items) { FormItem[] controls = new FormItem[items.length + 3]; int i = 0; for (FormItem item : items) { controls[i++] = item; } controls[i++] = new SpacerItem(); controls[i++] = confirmButton; controls[i++]...
[ "public", "void", "setControls", "(", "FormItem", "...", "items", ")", "{", "FormItem", "[", "]", "controls", "=", "new", "FormItem", "[", "items", ".", "length", "+", "3", "]", ";", "int", "i", "=", "0", ";", "for", "(", "FormItem", "item", ":", "...
Adds controls to this dialog. @param items controls
[ "Adds", "controls", "to", "this", "dialog", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/shared/ModalDialog.java#L110-L123
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java
FileUtil.unzip
public static void unzip(InputStream zipFile, String dest) throws IOException { byte[] buffer = new byte[1024]; //create output directory is not exists File folder = new File(dest); if (folder.exists()) { FileUtil.delete(folder); } folder.mkdir(); ...
java
public static void unzip(InputStream zipFile, String dest) throws IOException { byte[] buffer = new byte[1024]; //create output directory is not exists File folder = new File(dest); if (folder.exists()) { FileUtil.delete(folder); } folder.mkdir(); ...
[ "public", "static", "void", "unzip", "(", "InputStream", "zipFile", ",", "String", "dest", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "1024", "]", ";", "//create output directory is not exists", "File", "folder", "=...
Unzip archive to the specified destination. @param zipFile zip archive @param dest directory where archive will be uncompressed @throws IOException
[ "Unzip", "archive", "to", "the", "specified", "destination", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java#L206-L242
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java
FileUtil.zipDir
public static void zipDir(String dirName, String nameZipFile) throws IOException { try (FileOutputStream fW = new FileOutputStream(nameZipFile); ZipOutputStream zip = new ZipOutputStream(fW)) { addFolderToZip("", dirName, zip); } }
java
public static void zipDir(String dirName, String nameZipFile) throws IOException { try (FileOutputStream fW = new FileOutputStream(nameZipFile); ZipOutputStream zip = new ZipOutputStream(fW)) { addFolderToZip("", dirName, zip); } }
[ "public", "static", "void", "zipDir", "(", "String", "dirName", ",", "String", "nameZipFile", ")", "throws", "IOException", "{", "try", "(", "FileOutputStream", "fW", "=", "new", "FileOutputStream", "(", "nameZipFile", ")", ";", "ZipOutputStream", "zip", "=", ...
Compresses directory into zip archive. @param dirName the path to the directory @param nameZipFile archive name. @throws IOException
[ "Compresses", "directory", "into", "zip", "archive", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java#L251-L256
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java
FileUtil.addFolderToZip
public static void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws IOException { File folder = new File(srcFolder); if (folder.list().length == 0) { addFileToZip(path, srcFolder, zip, true); } else { for (String fileName : folder.list()) { ...
java
public static void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws IOException { File folder = new File(srcFolder); if (folder.list().length == 0) { addFileToZip(path, srcFolder, zip, true); } else { for (String fileName : folder.list()) { ...
[ "public", "static", "void", "addFolderToZip", "(", "String", "path", ",", "String", "srcFolder", ",", "ZipOutputStream", "zip", ")", "throws", "IOException", "{", "File", "folder", "=", "new", "File", "(", "srcFolder", ")", ";", "if", "(", "folder", ".", "...
Adds folder to the archive. @param path path to the folder @param srcFolder folder name @param zip zip archive @throws IOException
[ "Adds", "folder", "to", "the", "archive", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java#L266-L279
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java
FileUtil.addFileToZip
public static void addFileToZip(String path, String srcFile, ZipOutputStream zip, boolean flag) throws IOException { File folder = new File(srcFile); if (flag) { zip.putNextEntry(new ZipEntry(path + "/" + folder.getName() + "/")); } else { if (folder.isDirectory()) { ...
java
public static void addFileToZip(String path, String srcFile, ZipOutputStream zip, boolean flag) throws IOException { File folder = new File(srcFile); if (flag) { zip.putNextEntry(new ZipEntry(path + "/" + folder.getName() + "/")); } else { if (folder.isDirectory()) { ...
[ "public", "static", "void", "addFileToZip", "(", "String", "path", ",", "String", "srcFile", ",", "ZipOutputStream", "zip", ",", "boolean", "flag", ")", "throws", "IOException", "{", "File", "folder", "=", "new", "File", "(", "srcFile", ")", ";", "if", "("...
Appends file to the archive. @param path path to the file @param srcFile file name @param zip archive @param flag @throws IOException
[ "Appends", "file", "to", "the", "archive", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java#L290-L308
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java
FileUtil.getExtension
public static String getExtension(final String filename) { Objects.requireNonNull(filename, "filename cannot be null"); int lastDotIdx = filename.lastIndexOf("."); return lastDotIdx >= 0 ? filename.substring(lastDotIdx) : ""; }
java
public static String getExtension(final String filename) { Objects.requireNonNull(filename, "filename cannot be null"); int lastDotIdx = filename.lastIndexOf("."); return lastDotIdx >= 0 ? filename.substring(lastDotIdx) : ""; }
[ "public", "static", "String", "getExtension", "(", "final", "String", "filename", ")", "{", "Objects", ".", "requireNonNull", "(", "filename", ",", "\"filename cannot be null\"", ")", ";", "int", "lastDotIdx", "=", "filename", ".", "lastIndexOf", "(", "\".\"", "...
Returns the extension of a file, including the dot. @param filename the name of a file, may be not be null @return the file extension or an empty string if the extension cannot be determined.
[ "Returns", "the", "extension", "of", "a", "file", "including", "the", "dot", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/FileUtil.java#L316-L320
train
ModeShape/modeshape
sequencers/modeshape-sequencer-sramp/src/main/java/org/modeshape/sequencer/sramp/AbstractResolvingReader.java
AbstractResolvingReader.read
public void read( InputStream stream, Node outputNode ) throws Exception { read(new InputSource(stream), outputNode); }
java
public void read( InputStream stream, Node outputNode ) throws Exception { read(new InputSource(stream), outputNode); }
[ "public", "void", "read", "(", "InputStream", "stream", ",", "Node", "outputNode", ")", "throws", "Exception", "{", "read", "(", "new", "InputSource", "(", "stream", ")", ",", "outputNode", ")", ";", "}" ]
Read the document from the supplied stream, and produce the derived content. @param stream the stream; may not be null @param outputNode the parent node at which the derived content should be written; may not be null @throws Exception if there is a problem reading the XSD content
[ "Read", "the", "document", "from", "the", "supplied", "stream", "and", "produce", "the", "derived", "content", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-sramp/src/main/java/org/modeshape/sequencer/sramp/AbstractResolvingReader.java#L75-L78
train
ModeShape/modeshape
modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java
JcrManagedConnection.openSession
private JcrSession openSession() throws ResourceException { try { Repository repo = mcf.getRepository(); Session s = repo.login(cri.getCredentials(), cri.getWorkspace()); return (JcrSession) s; } catch (RepositoryException e) { throw new ResourceException(...
java
private JcrSession openSession() throws ResourceException { try { Repository repo = mcf.getRepository(); Session s = repo.login(cri.getCredentials(), cri.getWorkspace()); return (JcrSession) s; } catch (RepositoryException e) { throw new ResourceException(...
[ "private", "JcrSession", "openSession", "(", ")", "throws", "ResourceException", "{", "try", "{", "Repository", "repo", "=", "mcf", ".", "getRepository", "(", ")", ";", "Session", "s", "=", "repo", ".", "login", "(", "cri", ".", "getCredentials", "(", ")",...
Create a new session. @return new JCR session handle object. @throws ResourceException if there is an error opening the session
[ "Create", "a", "new", "session", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java#L126-L134
train
ModeShape/modeshape
modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java
JcrManagedConnection.destroy
@Override public void destroy() throws ResourceException { LOGGER.debug("Shutting down connection to repo '{0}'", mcf.getRepositoryURL()); this.session.logout(); this.handles.clear(); }
java
@Override public void destroy() throws ResourceException { LOGGER.debug("Shutting down connection to repo '{0}'", mcf.getRepositoryURL()); this.session.logout(); this.handles.clear(); }
[ "@", "Override", "public", "void", "destroy", "(", ")", "throws", "ResourceException", "{", "LOGGER", ".", "debug", "(", "\"Shutting down connection to repo '{0}'\"", ",", "mcf", ".", "getRepositoryURL", "(", ")", ")", ";", "this", ".", "session", ".", "logout",...
Destroys the physical connection to the underlying resource manager. @throws ResourceException generic exception if operation fails
[ "Destroys", "the", "physical", "connection", "to", "the", "underlying", "resource", "manager", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java#L187-L192
train
ModeShape/modeshape
modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java
JcrManagedConnection.getMetaData
@Override public ManagedConnectionMetaData getMetaData() throws ResourceException { try { return new JcrManagedConnectionMetaData(mcf.getRepository(), session); } catch (Exception e) { throw new ResourceException(e); } }
java
@Override public ManagedConnectionMetaData getMetaData() throws ResourceException { try { return new JcrManagedConnectionMetaData(mcf.getRepository(), session); } catch (Exception e) { throw new ResourceException(e); } }
[ "@", "Override", "public", "ManagedConnectionMetaData", "getMetaData", "(", ")", "throws", "ResourceException", "{", "try", "{", "return", "new", "JcrManagedConnectionMetaData", "(", "mcf", ".", "getRepository", "(", ")", ",", "session", ")", ";", "}", "catch", ...
Gets the metadata information for this connection's underlying EIS resource manager instance. @return ManagedConnectionMetaData instance @throws ResourceException generic exception if operation fails
[ "Gets", "the", "metadata", "information", "for", "this", "connection", "s", "underlying", "EIS", "resource", "manager", "instance", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java#L283-L290
train
ModeShape/modeshape
modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java
JcrManagedConnection.getSession
public Session getSession( JcrSessionHandle handle ) { if ((handles.size() > 0) && (handles.get(0) == handle)) { return session; } throw new java.lang.IllegalStateException("Inactive logical session handle called"); }
java
public Session getSession( JcrSessionHandle handle ) { if ((handles.size() > 0) && (handles.get(0) == handle)) { return session; } throw new java.lang.IllegalStateException("Inactive logical session handle called"); }
[ "public", "Session", "getSession", "(", "JcrSessionHandle", "handle", ")", "{", "if", "(", "(", "handles", ".", "size", "(", ")", ">", "0", ")", "&&", "(", "handles", ".", "get", "(", "0", ")", "==", "handle", ")", ")", "{", "return", "session", ";...
Searches session object using handle. @param handle the session handle @return session related to specified handle.
[ "Searches", "session", "object", "using", "handle", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnection.java#L298-L303
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.combineLines
public static String combineLines( String[] lines, char separator ) { if (lines == null || lines.length == 0) return ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i != lines.length; ++i) { String line = lines[i]; if (i ...
java
public static String combineLines( String[] lines, char separator ) { if (lines == null || lines.length == 0) return ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i != lines.length; ++i) { String line = lines[i]; if (i ...
[ "public", "static", "String", "combineLines", "(", "String", "[", "]", "lines", ",", "char", "separator", ")", "{", "if", "(", "lines", "==", "null", "||", "lines", ".", "length", "==", "0", ")", "return", "\"\"", ";", "StringBuilder", "sb", "=", "new"...
Combine the lines into a single string, using the supplied separator as the delimiter. @param lines the lines to be combined @param separator the separator character @return the combined lines, or an empty string if there are no lines
[ "Combine", "the", "lines", "into", "a", "single", "string", "using", "the", "supplied", "separator", "as", "the", "delimiter", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L67-L77
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.splitLines
public static List<String> splitLines( final String content ) { if (content == null || content.length() == 0) return Collections.emptyList(); String[] lines = content.split("[\\r]?\\n"); return Arrays.asList(lines); }
java
public static List<String> splitLines( final String content ) { if (content == null || content.length() == 0) return Collections.emptyList(); String[] lines = content.split("[\\r]?\\n"); return Arrays.asList(lines); }
[ "public", "static", "List", "<", "String", ">", "splitLines", "(", "final", "String", "content", ")", "{", "if", "(", "content", "==", "null", "||", "content", ".", "length", "(", ")", "==", "0", ")", "return", "Collections", ".", "emptyList", "(", ")"...
Split the supplied content into lines, returning each line as an element in the returned list. @param content the string content that is to be split @return the list of lines; never null but may be an empty (unmodifiable) list if the supplied content is null or empty
[ "Split", "the", "supplied", "content", "into", "lines", "returning", "each", "line", "as", "an", "element", "in", "the", "returned", "list", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L85-L89
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.createString
public static String createString( final char charToRepeat, int numberOfRepeats ) { assert numberOfRepeats >= 0; StringBuilder sb = new StringBuilder(); for (int i = 0; i < numberOfRepeats; ++i) { sb.append(charToRepeat); } retur...
java
public static String createString( final char charToRepeat, int numberOfRepeats ) { assert numberOfRepeats >= 0; StringBuilder sb = new StringBuilder(); for (int i = 0; i < numberOfRepeats; ++i) { sb.append(charToRepeat); } retur...
[ "public", "static", "String", "createString", "(", "final", "char", "charToRepeat", ",", "int", "numberOfRepeats", ")", "{", "assert", "numberOfRepeats", ">=", "0", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i...
Create a new string containing the specified character repeated a specific number of times. @param charToRepeat the character to repeat @param numberOfRepeats the number of times the character is to repeat in the result; must be greater than 0 @return the resulting string
[ "Create", "a", "new", "string", "containing", "the", "specified", "character", "repeated", "a", "specific", "number", "of", "times", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L206-L214
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.justify
public static String justify( Justify justify, String str, final int width, char padWithChar ) { switch (justify) { case LEFT: return justifyLeft(str, width, padWithChar); ...
java
public static String justify( Justify justify, String str, final int width, char padWithChar ) { switch (justify) { case LEFT: return justifyLeft(str, width, padWithChar); ...
[ "public", "static", "String", "justify", "(", "Justify", "justify", ",", "String", "str", ",", "final", "int", "width", ",", "char", "padWithChar", ")", "{", "switch", "(", "justify", ")", "{", "case", "LEFT", ":", "return", "justifyLeft", "(", "str", ",...
Justify the contents of the string. @param justify the way in which the string is to be justified @param str the string to be right justified; if null, an empty string is used @param width the desired width of the string; must be positive @param padWithChar the character to use for padding, if needed @return the right...
[ "Justify", "the", "contents", "of", "the", "string", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L248-L262
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.justifyRight
public static String justifyRight( String str, final int width, char padWithChar ) { assert width > 0; // Trim the leading and trailing whitespace ... str = str != null ? str.trim() : ""; final int length = st...
java
public static String justifyRight( String str, final int width, char padWithChar ) { assert width > 0; // Trim the leading and trailing whitespace ... str = str != null ? str.trim() : ""; final int length = st...
[ "public", "static", "String", "justifyRight", "(", "String", "str", ",", "final", "int", "width", ",", "char", "padWithChar", ")", "{", "assert", "width", ">", "0", ";", "// Trim the leading and trailing whitespace ...", "str", "=", "str", "!=", "null", "?", "...
Right justify the contents of the string, ensuring that the string ends at the last character. If the supplied string is longer than the desired width, the leading characters are removed so that the last character in the supplied string at the last position. If the supplied string is shorter than the desired width, the...
[ "Right", "justify", "the", "contents", "of", "the", "string", "ensuring", "that", "the", "string", "ends", "at", "the", "last", "character", ".", "If", "the", "supplied", "string", "is", "longer", "than", "the", "desired", "width", "the", "leading", "charact...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L276-L299
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.justifyLeft
public static String justifyLeft( String str, final int width, char padWithChar ) { return justifyLeft(str, width, padWithChar, true); }
java
public static String justifyLeft( String str, final int width, char padWithChar ) { return justifyLeft(str, width, padWithChar, true); }
[ "public", "static", "String", "justifyLeft", "(", "String", "str", ",", "final", "int", "width", ",", "char", "padWithChar", ")", "{", "return", "justifyLeft", "(", "str", ",", "width", ",", "padWithChar", ",", "true", ")", ";", "}" ]
Left justify the contents of the string, ensuring that the supplied string begins at the first character and that the resulting string is of the desired length. If the supplied string is longer than the desired width, it is truncated to the specified length. If the supplied string is shorter than the desired width, the...
[ "Left", "justify", "the", "contents", "of", "the", "string", "ensuring", "that", "the", "supplied", "string", "begins", "at", "the", "first", "character", "and", "that", "the", "resulting", "string", "is", "of", "the", "desired", "length", ".", "If", "the", ...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L313-L317
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.justifyCenter
public static String justifyCenter( String str, final int width, char padWithChar ) { // Trim the leading and trailing whitespace ... str = str != null ? str.trim() : ""; int addChars = width - str.length(); ...
java
public static String justifyCenter( String str, final int width, char padWithChar ) { // Trim the leading and trailing whitespace ... str = str != null ? str.trim() : ""; int addChars = width - str.length(); ...
[ "public", "static", "String", "justifyCenter", "(", "String", "str", ",", "final", "int", "width", ",", "char", "padWithChar", ")", "{", "// Trim the leading and trailing whitespace ...", "str", "=", "str", "!=", "null", "?", "str", ".", "trim", "(", ")", ":",...
Center the contents of the string. If the supplied string is longer than the desired width, it is truncated to the specified length. If the supplied string is shorter than the desired width, padding characters are added to the beginning and end of the string such that the length is that specified; one additional paddin...
[ "Center", "the", "contents", "of", "the", "string", ".", "If", "the", "supplied", "string", "is", "longer", "than", "the", "desired", "width", "it", "is", "truncated", "to", "the", "specified", "length", ".", "If", "the", "supplied", "string", "is", "short...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L356-L392
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.truncate
public static String truncate( Object obj, int maxLength, String suffix ) { CheckArg.isNonNegative(maxLength, "maxLength"); if (obj == null || maxLength == 0) { return ""; } String str = obj.toString(); ...
java
public static String truncate( Object obj, int maxLength, String suffix ) { CheckArg.isNonNegative(maxLength, "maxLength"); if (obj == null || maxLength == 0) { return ""; } String str = obj.toString(); ...
[ "public", "static", "String", "truncate", "(", "Object", "obj", ",", "int", "maxLength", ",", "String", "suffix", ")", "{", "CheckArg", ".", "isNonNegative", "(", "maxLength", ",", "\"maxLength\"", ")", ";", "if", "(", "obj", "==", "null", "||", "maxLength...
Truncate the supplied string to be no more than the specified length. This method returns an empty string if the supplied object is null. @param obj the object from which the string is to be obtained using {@link Object#toString()}. @param maxLength the maximum length of the string being returned @param suffix the suf...
[ "Truncate", "the", "supplied", "string", "to", "be", "no", "more", "than", "the", "specified", "length", ".", "This", "method", "returns", "an", "empty", "string", "if", "the", "supplied", "object", "is", "null", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L421-L439
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.getStackTrace
public static String getStackTrace( Throwable throwable ) { if (throwable == null) return null; final ByteArrayOutputStream bas = new ByteArrayOutputStream(); final PrintWriter pw = new PrintWriter(bas); throwable.printStackTrace(pw); pw.close(); return bas.toString(); ...
java
public static String getStackTrace( Throwable throwable ) { if (throwable == null) return null; final ByteArrayOutputStream bas = new ByteArrayOutputStream(); final PrintWriter pw = new PrintWriter(bas); throwable.printStackTrace(pw); pw.close(); return bas.toString(); ...
[ "public", "static", "String", "getStackTrace", "(", "Throwable", "throwable", ")", "{", "if", "(", "throwable", "==", "null", ")", "return", "null", ";", "final", "ByteArrayOutputStream", "bas", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "final", "Pri...
Get the stack trace of the supplied exception. @param throwable the exception for which the stack trace is to be returned @return the stack trace, or null if the supplied exception is null
[ "Get", "the", "stack", "trace", "of", "the", "supplied", "exception", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L499-L506
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.normalize
public static String normalize( String text ) { CheckArg.isNotNull(text, "text"); // This could be much more efficient. return NORMALIZE_PATTERN.matcher(text).replaceAll(" ").trim(); }
java
public static String normalize( String text ) { CheckArg.isNotNull(text, "text"); // This could be much more efficient. return NORMALIZE_PATTERN.matcher(text).replaceAll(" ").trim(); }
[ "public", "static", "String", "normalize", "(", "String", "text", ")", "{", "CheckArg", ".", "isNotNull", "(", "text", ",", "\"text\"", ")", ";", "// This could be much more efficient.", "return", "NORMALIZE_PATTERN", ".", "matcher", "(", "text", ")", ".", "repl...
Removes leading and trailing whitespace from the supplied text, and reduces other consecutive whitespace characters to a single space. Whitespace includes line-feeds. @param text the text to be normalized @return the normalized text
[ "Removes", "leading", "and", "trailing", "whitespace", "from", "the", "supplied", "text", "and", "reduces", "other", "consecutive", "whitespace", "characters", "to", "a", "single", "space", ".", "Whitespace", "includes", "line", "-", "feeds", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L515-L519
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.getHexString
public static String getHexString( byte[] bytes ) { try { byte[] hex = new byte[2 * bytes.length]; int index = 0; for (byte b : bytes) { int v = b & 0xFF; hex[index++] = HEX_CHAR_TABLE[v >>> 4]; hex[index++] = HEX_CHAR_TABLE[v ...
java
public static String getHexString( byte[] bytes ) { try { byte[] hex = new byte[2 * bytes.length]; int index = 0; for (byte b : bytes) { int v = b & 0xFF; hex[index++] = HEX_CHAR_TABLE[v >>> 4]; hex[index++] = HEX_CHAR_TABLE[v ...
[ "public", "static", "String", "getHexString", "(", "byte", "[", "]", "bytes", ")", "{", "try", "{", "byte", "[", "]", "hex", "=", "new", "byte", "[", "2", "*", "bytes", ".", "length", "]", ";", "int", "index", "=", "0", ";", "for", "(", "byte", ...
Get the hexadecimal string representation of the supplied byte array. @param bytes the byte array @return the hex string representation of the byte array; never null
[ "Get", "the", "hexadecimal", "string", "representation", "of", "the", "supplied", "byte", "array", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L530-L545
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java
StringUtil.containsAnyOf
public static boolean containsAnyOf( String str, char... chars ) { CharacterIterator iter = new StringCharacterIterator(str); for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { for (char match : chars) { if (c ...
java
public static boolean containsAnyOf( String str, char... chars ) { CharacterIterator iter = new StringCharacterIterator(str); for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { for (char match : chars) { if (c ...
[ "public", "static", "boolean", "containsAnyOf", "(", "String", "str", ",", "char", "...", "chars", ")", "{", "CharacterIterator", "iter", "=", "new", "StringCharacterIterator", "(", "str", ")", ";", "for", "(", "char", "c", "=", "iter", ".", "first", "(", ...
Return whether the supplied string contains any of the supplied characters. @param str the string to be examined; may not be null @param chars the characters to be found within the supplied string; may be zero-length @return true if the supplied string contains at least one of the supplied characters, or false otherwi...
[ "Return", "whether", "the", "supplied", "string", "contains", "any", "of", "the", "supplied", "characters", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/StringUtil.java#L599-L608
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryLockManager.java
RepositoryLockManager.refreshFromSystem
protected void refreshFromSystem() { try { // Re-read and re-register all of the namespaces ... SessionCache systemCache = repository.createSystemSession(repository.context(), false); SystemContent system = new SystemContent(systemCache); CachedNode locks = system...
java
protected void refreshFromSystem() { try { // Re-read and re-register all of the namespaces ... SessionCache systemCache = repository.createSystemSession(repository.context(), false); SystemContent system = new SystemContent(systemCache); CachedNode locks = system...
[ "protected", "void", "refreshFromSystem", "(", ")", "{", "try", "{", "// Re-read and re-register all of the namespaces ...", "SessionCache", "systemCache", "=", "repository", ".", "createSystemSession", "(", "repository", ".", "context", "(", ")", ",", "false", ")", "...
Refresh the locks from the stored representation.
[ "Refresh", "the", "locks", "from", "the", "stored", "representation", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryLockManager.java#L120-L156
train
ModeShape/modeshape
sequencers/modeshape-sequencer-java/src/main/java/org/modeshape/sequencer/javafile/JdtRecorder.java
JdtRecorder.record
protected void record( final Sequencer.Context context, final char[] sourceCode, final Node outputNode ) throws Exception { if ((sourceCode == null) || (sourceCode.length == 0)) { LOGGER.debug("No source code was found for output node {0}", outpu...
java
protected void record( final Sequencer.Context context, final char[] sourceCode, final Node outputNode ) throws Exception { if ((sourceCode == null) || (sourceCode.length == 0)) { LOGGER.debug("No source code was found for output node {0}", outpu...
[ "protected", "void", "record", "(", "final", "Sequencer", ".", "Context", "context", ",", "final", "char", "[", "]", "sourceCode", ",", "final", "Node", "outputNode", ")", "throws", "Exception", "{", "if", "(", "(", "sourceCode", "==", "null", ")", "||", ...
Convert the compilation unit into JCR nodes. @param context the sequencer context @param sourceCode the source code being recorded (can be <code>null</code> if there is no source code) @param outputNode the {@link Node node} where the output will be saved (cannot be <code>null</code>) @throws Exception if there is a p...
[ "Convert", "the", "compilation", "unit", "into", "JCR", "nodes", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-java/src/main/java/org/modeshape/sequencer/javafile/JdtRecorder.java#L922-L936
train
ModeShape/modeshape
sequencers/modeshape-sequencer-java/src/main/java/org/modeshape/sequencer/javafile/AbstractJavaMetadata.java
AbstractJavaMetadata.getTypeName
private String getTypeName( Type type ) { CheckArg.isNotNull(type, "type"); if (type.isPrimitiveType()) { PrimitiveType primitiveType = (PrimitiveType)type; return primitiveType.getPrimitiveTypeCode().toString(); } if (type.isSimpleType()) { SimpleType...
java
private String getTypeName( Type type ) { CheckArg.isNotNull(type, "type"); if (type.isPrimitiveType()) { PrimitiveType primitiveType = (PrimitiveType)type; return primitiveType.getPrimitiveTypeCode().toString(); } if (type.isSimpleType()) { SimpleType...
[ "private", "String", "getTypeName", "(", "Type", "type", ")", "{", "CheckArg", ".", "isNotNull", "(", "type", ",", "\"type\"", ")", ";", "if", "(", "type", ".", "isPrimitiveType", "(", ")", ")", "{", "PrimitiveType", "primitiveType", "=", "(", "PrimitiveTy...
Extract the type name @param type - the type to be processed. This can be primitive, simple, parameterized ... @return the name of a type. @throws IllegalArgumentException if type is null.
[ "Extract", "the", "type", "name" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-java/src/main/java/org/modeshape/sequencer/javafile/AbstractJavaMetadata.java#L455-L484
train
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/database/DatabaseUtil.java
DatabaseUtil.determineType
public static DatabaseType determineType(DatabaseMetaData metaData) throws SQLException { metaData = Objects.requireNonNull(metaData, "metaData cannot be null"); int majorVersion = metaData.getDatabaseMajorVersion(); int minorVersion = metaData.getDatabaseMinorVersion(); String name = me...
java
public static DatabaseType determineType(DatabaseMetaData metaData) throws SQLException { metaData = Objects.requireNonNull(metaData, "metaData cannot be null"); int majorVersion = metaData.getDatabaseMajorVersion(); int minorVersion = metaData.getDatabaseMinorVersion(); String name = me...
[ "public", "static", "DatabaseType", "determineType", "(", "DatabaseMetaData", "metaData", ")", "throws", "SQLException", "{", "metaData", "=", "Objects", ".", "requireNonNull", "(", "metaData", ",", "\"metaData cannot be null\"", ")", ";", "int", "majorVersion", "=", ...
Determine the type of a database, based on the metadata information from the DB metadata. @param metaData a {@link DatabaseMetaData} instance, may not be null @return a {@link DatabaseType} instance, never null @throws SQLException if a database access error occurs or this method is called on a closed connection
[ "Determine", "the", "type", "of", "a", "database", "based", "on", "the", "metadata", "information", "from", "the", "DB", "metadata", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/database/DatabaseUtil.java#L41-L78
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java
ClusteringService.addConsumer
@SuppressWarnings( "unchecked" ) public synchronized void addConsumer( MessageConsumer<? extends Serializable> consumer ) { consumers.add((MessageConsumer<Serializable>)consumer); }
java
@SuppressWarnings( "unchecked" ) public synchronized void addConsumer( MessageConsumer<? extends Serializable> consumer ) { consumers.add((MessageConsumer<Serializable>)consumer); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "synchronized", "void", "addConsumer", "(", "MessageConsumer", "<", "?", "extends", "Serializable", ">", "consumer", ")", "{", "consumers", ".", "add", "(", "(", "MessageConsumer", "<", "Serializable", ...
Adds a new message consumer to this service. @param consumer a {@link MessageConsumer} instance.
[ "Adds", "a", "new", "message", "consumer", "to", "this", "service", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java#L141-L144
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java
ClusteringService.shutdown
public synchronized boolean shutdown() { if (channel == null) { return false; } Address address = channel.getAddress(); LOGGER.debug("{0} shutting down clustering service...", address); consumers.clear(); // Mark this as not accepting any more ... isO...
java
public synchronized boolean shutdown() { if (channel == null) { return false; } Address address = channel.getAddress(); LOGGER.debug("{0} shutting down clustering service...", address); consumers.clear(); // Mark this as not accepting any more ... isO...
[ "public", "synchronized", "boolean", "shutdown", "(", ")", "{", "if", "(", "channel", "==", "null", ")", "{", "return", "false", ";", "}", "Address", "address", "=", "channel", ".", "getAddress", "(", ")", ";", "LOGGER", ".", "debug", "(", "\"{0} shuttin...
Shuts down and clears resources held by this service. @return {@code true} if the service has been shutdown or {@code false} if it had already been shut down.
[ "Shuts", "down", "and", "clears", "resources", "held", "by", "this", "service", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java#L151-L174
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java
ClusteringService.sendMessage
public boolean sendMessage( Serializable payload ) { if (!isOpen() || !multipleMembersInCluster()) { return false; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("{0} SENDING {1} ", toString(), payload); } try { byte[] messageData = toByteArray...
java
public boolean sendMessage( Serializable payload ) { if (!isOpen() || !multipleMembersInCluster()) { return false; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("{0} SENDING {1} ", toString(), payload); } try { byte[] messageData = toByteArray...
[ "public", "boolean", "sendMessage", "(", "Serializable", "payload", ")", "{", "if", "(", "!", "isOpen", "(", ")", "||", "!", "multipleMembersInCluster", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")"...
Sends a message of a given type across a cluster. @param payload the main body of the message; must not be {@code null} @return {@code true} if the send operation was successful, {@code false} otherwise
[ "Sends", "a", "message", "of", "a", "given", "type", "across", "a", "cluster", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java#L227-L244
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java
ClusteringService.startStandalone
public static ClusteringService startStandalone( String clusterName, String jgroupsConfig ) { ClusteringService clusteringService = new StandaloneClusteringService(clusterName, jgroupsConfig); clusteringService.init(); return clusteringService...
java
public static ClusteringService startStandalone( String clusterName, String jgroupsConfig ) { ClusteringService clusteringService = new StandaloneClusteringService(clusterName, jgroupsConfig); clusteringService.init(); return clusteringService...
[ "public", "static", "ClusteringService", "startStandalone", "(", "String", "clusterName", ",", "String", "jgroupsConfig", ")", "{", "ClusteringService", "clusteringService", "=", "new", "StandaloneClusteringService", "(", "clusterName", ",", "jgroupsConfig", ")", ";", "...
Starts a standalone clustering service which in turn will start & connect its own JGroup channel. @param clusterName the name of the cluster to which the JGroups channel should connect; may not be null @param jgroupsConfig either the path or the XML content of a JGroups configuration file; may not be null @return a {@...
[ "Starts", "a", "standalone", "clustering", "service", "which", "in", "turn", "will", "start", "&", "connect", "its", "own", "JGroup", "channel", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java#L260-L265
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java
ClusteringService.startStandalone
public static ClusteringService startStandalone(String clusterName, Channel channel) { ClusteringService clusteringService = new StandaloneClusteringService(clusterName, channel); clusteringService.init(); return clusteringService; }
java
public static ClusteringService startStandalone(String clusterName, Channel channel) { ClusteringService clusteringService = new StandaloneClusteringService(clusterName, channel); clusteringService.init(); return clusteringService; }
[ "public", "static", "ClusteringService", "startStandalone", "(", "String", "clusterName", ",", "Channel", "channel", ")", "{", "ClusteringService", "clusteringService", "=", "new", "StandaloneClusteringService", "(", "clusterName", ",", "channel", ")", ";", "clusteringS...
Starts a standalone clustering service which uses the supplied channel. @param clusterName the name of the cluster to which the JGroups channel should connect; may not be null @param channel a {@link Channel} instance, may not be {@code null} @return a {@link org.modeshape.jcr.clustering.ClusteringService} instance,...
[ "Starts", "a", "standalone", "clustering", "service", "which", "uses", "the", "supplied", "channel", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java#L275-L279
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java
ClusteringService.startForked
public static ClusteringService startForked( Channel mainChannel ) { if (!mainChannel.isConnected()) { throw new IllegalStateException(ClusteringI18n.channelNotConnected.text()); } ClusteringService clusteringService = new ForkedClusteringService(mainChannel);...
java
public static ClusteringService startForked( Channel mainChannel ) { if (!mainChannel.isConnected()) { throw new IllegalStateException(ClusteringI18n.channelNotConnected.text()); } ClusteringService clusteringService = new ForkedClusteringService(mainChannel);...
[ "public", "static", "ClusteringService", "startForked", "(", "Channel", "mainChannel", ")", "{", "if", "(", "!", "mainChannel", ".", "isConnected", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "ClusteringI18n", ".", "channelNotConnected", ".",...
Starts a new clustering service by forking a channel of an existing JGroups channel. @param mainChannel a {@link Channel} instance; may not be null. @return a {@link org.modeshape.jcr.clustering.ClusteringService} instance, never null
[ "Starts", "a", "new", "clustering", "service", "by", "forking", "a", "channel", "of", "an", "existing", "JGroups", "channel", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/clustering/ClusteringService.java#L287-L294
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.isNotOneOf
public boolean isNotOneOf( Type first, Type... rest ) { return isNotOneOf(EnumSet.of(first, rest)); }
java
public boolean isNotOneOf( Type first, Type... rest ) { return isNotOneOf(EnumSet.of(first, rest)); }
[ "public", "boolean", "isNotOneOf", "(", "Type", "first", ",", "Type", "...", "rest", ")", "{", "return", "isNotOneOf", "(", "EnumSet", ".", "of", "(", "first", ",", "rest", ")", ")", ";", "}" ]
Return true if this node's type does not match any of the supplied types @param first the type to compare @param rest the additional types to compare @return true if this node's type is different than all of those supplied, or false if matches one of the supplied types
[ "Return", "true", "if", "this", "node", "s", "type", "does", "not", "match", "any", "of", "the", "supplied", "types" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L343-L346
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.isOneOf
public boolean isOneOf( Type first, Type... rest ) { return isOneOf(EnumSet.of(first, rest)); }
java
public boolean isOneOf( Type first, Type... rest ) { return isOneOf(EnumSet.of(first, rest)); }
[ "public", "boolean", "isOneOf", "(", "Type", "first", ",", "Type", "...", "rest", ")", "{", "return", "isOneOf", "(", "EnumSet", ".", "of", "(", "first", ",", "rest", ")", ")", ";", "}" ]
Return true if this node's type matches one of the supplied types @param first the type to compare @param rest the additional types to compare @return true if this node's type is one of those supplied, or false otherwise
[ "Return", "true", "if", "this", "node", "s", "type", "matches", "one", "of", "the", "supplied", "types" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L375-L378
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.isBelow
public boolean isBelow( PlanNode possibleAncestor ) { PlanNode node = this; while (node != null) { if (node == possibleAncestor) return true; node = node.getParent(); } return false; }
java
public boolean isBelow( PlanNode possibleAncestor ) { PlanNode node = this; while (node != null) { if (node == possibleAncestor) return true; node = node.getParent(); } return false; }
[ "public", "boolean", "isBelow", "(", "PlanNode", "possibleAncestor", ")", "{", "PlanNode", "node", "=", "this", ";", "while", "(", "node", "!=", "null", ")", "{", "if", "(", "node", "==", "possibleAncestor", ")", "return", "true", ";", "node", "=", "node...
Determine if the supplied node is an ancestor of this node. @param possibleAncestor the node that is to be determined if it is an ancestor @return true if the supplied node is indeed an ancestor, or false if it is not an ancestor
[ "Determine", "if", "the", "supplied", "node", "is", "an", "ancestor", "of", "this", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L396-L403
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.replaceChild
public boolean replaceChild( PlanNode child, PlanNode replacement ) { assert child != null; assert replacement != null; if (child.parent == this) { int i = this.children.indexOf(child); if (replacement.parent == this) { // ...
java
public boolean replaceChild( PlanNode child, PlanNode replacement ) { assert child != null; assert replacement != null; if (child.parent == this) { int i = this.children.indexOf(child); if (replacement.parent == this) { // ...
[ "public", "boolean", "replaceChild", "(", "PlanNode", "child", ",", "PlanNode", "replacement", ")", "{", "assert", "child", "!=", "null", ";", "assert", "replacement", "!=", "null", ";", "if", "(", "child", ".", "parent", "==", "this", ")", "{", "int", "...
Replace the supplied child with another node. If the replacement is already a child of this node, this method effectively swaps the position of the child and replacement nodes. @param child the node that is already a child and that is to be replaced; may not be null and must be a child @param replacement the node that...
[ "Replace", "the", "supplied", "child", "with", "another", "node", ".", "If", "the", "replacement", "is", "already", "a", "child", "of", "this", "node", "this", "method", "effectively", "swaps", "the", "position", "of", "the", "child", "and", "replacement", "...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L541-L562
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.getPropertyKeys
public Set<Property> getPropertyKeys() { return nodeProperties != null ? nodeProperties.keySet() : Collections.<Property>emptySet(); }
java
public Set<Property> getPropertyKeys() { return nodeProperties != null ? nodeProperties.keySet() : Collections.<Property>emptySet(); }
[ "public", "Set", "<", "Property", ">", "getPropertyKeys", "(", ")", "{", "return", "nodeProperties", "!=", "null", "?", "nodeProperties", ".", "keySet", "(", ")", ":", "Collections", ".", "<", "Property", ">", "emptySet", "(", ")", ";", "}" ]
Get the keys for the property values that are set on this node. @return the property keys; never null but possibly empty
[ "Get", "the", "keys", "for", "the", "property", "values", "that", "are", "set", "on", "this", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L708-L710
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.getProperty
public Object getProperty( Property propertyId ) { return nodeProperties != null ? nodeProperties.get(propertyId) : null; }
java
public Object getProperty( Property propertyId ) { return nodeProperties != null ? nodeProperties.get(propertyId) : null; }
[ "public", "Object", "getProperty", "(", "Property", "propertyId", ")", "{", "return", "nodeProperties", "!=", "null", "?", "nodeProperties", ".", "get", "(", "propertyId", ")", ":", "null", ";", "}" ]
Get the node's value for this supplied property. @param propertyId the property identifier @return the value, or null if there is no property on this node
[ "Get", "the", "node", "s", "value", "for", "this", "supplied", "property", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L718-L720
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.getProperty
public <ValueType> ValueType getProperty( Property propertyId, Class<ValueType> type ) { return nodeProperties != null ? type.cast(nodeProperties.get(propertyId)) : null; }
java
public <ValueType> ValueType getProperty( Property propertyId, Class<ValueType> type ) { return nodeProperties != null ? type.cast(nodeProperties.get(propertyId)) : null; }
[ "public", "<", "ValueType", ">", "ValueType", "getProperty", "(", "Property", "propertyId", ",", "Class", "<", "ValueType", ">", "type", ")", "{", "return", "nodeProperties", "!=", "null", "?", "type", ".", "cast", "(", "nodeProperties", ".", "get", "(", "...
Get the node's value for this supplied property, casting the result to the supplied type. @param <ValueType> the type of the value expected @param propertyId the property identifier @param type the class denoting the type of value expected; may not be null @return the value, or null if there is no property on this nod...
[ "Get", "the", "node", "s", "value", "for", "this", "supplied", "property", "casting", "the", "result", "to", "the", "supplied", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L730-L733
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.setProperty
public Object setProperty( Property propertyId, Object value ) { if (value == null) { // Removing this property ... return nodeProperties != null ? nodeProperties.remove(propertyId) : null; } // Otherwise, we're adding the property i...
java
public Object setProperty( Property propertyId, Object value ) { if (value == null) { // Removing this property ... return nodeProperties != null ? nodeProperties.remove(propertyId) : null; } // Otherwise, we're adding the property i...
[ "public", "Object", "setProperty", "(", "Property", "propertyId", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "// Removing this property ...", "return", "nodeProperties", "!=", "null", "?", "nodeProperties", ".", "remove", "(", ...
Set the node's value for the supplied property. @param propertyId the property identifier @param value the value, or null if the property is to be removed @return the previous value that was overwritten by this call, or null if there was prior value
[ "Set", "the", "node", "s", "value", "for", "the", "supplied", "property", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L779-L788
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.removeProperty
public Object removeProperty( Object propertyId ) { return nodeProperties != null ? nodeProperties.remove(propertyId) : null; }
java
public Object removeProperty( Object propertyId ) { return nodeProperties != null ? nodeProperties.remove(propertyId) : null; }
[ "public", "Object", "removeProperty", "(", "Object", "propertyId", ")", "{", "return", "nodeProperties", "!=", "null", "?", "nodeProperties", ".", "remove", "(", "propertyId", ")", ":", "null", ";", "}" ]
Remove the node's value for this supplied property. @param propertyId the property identifier @return the value that was removed, or null if there was no property on this node
[ "Remove", "the", "node", "s", "value", "for", "this", "supplied", "property", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L796-L798
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.hasCollectionProperty
public boolean hasCollectionProperty( Property propertyId ) { Object value = getProperty(propertyId); return (value instanceof Collection<?> && !((Collection<?>)value).isEmpty()); }
java
public boolean hasCollectionProperty( Property propertyId ) { Object value = getProperty(propertyId); return (value instanceof Collection<?> && !((Collection<?>)value).isEmpty()); }
[ "public", "boolean", "hasCollectionProperty", "(", "Property", "propertyId", ")", "{", "Object", "value", "=", "getProperty", "(", "propertyId", ")", ";", "return", "(", "value", "instanceof", "Collection", "<", "?", ">", "&&", "!", "(", "(", "Collection", "...
Indicates if there is a non-null and non-empty Collection value for the property. @param propertyId the property identifier @return true if this node has value for the supplied property and that value is a non-empty Collection
[ "Indicates", "if", "there", "is", "a", "non", "-", "null", "and", "non", "-", "empty", "Collection", "value", "for", "the", "property", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L816-L819
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.replaceSelector
public boolean replaceSelector( SelectorName original, SelectorName replacement ) { if (original != null && replacement != null) { if (selectors.remove(original)) { selectors.add(replacement); return true; } } ...
java
public boolean replaceSelector( SelectorName original, SelectorName replacement ) { if (original != null && replacement != null) { if (selectors.remove(original)) { selectors.add(replacement); return true; } } ...
[ "public", "boolean", "replaceSelector", "(", "SelectorName", "original", ",", "SelectorName", "replacement", ")", "{", "if", "(", "original", "!=", "null", "&&", "replacement", "!=", "null", ")", "{", "if", "(", "selectors", ".", "remove", "(", "original", "...
Replace this plan's use of the named selector with the replacement. to this plan node. This method does nothing if either of the supplied selector names is null, or if the supplied original selector name is not found. @param original the selector name to be replaced @param replacement the selector name to replace the ...
[ "Replace", "this", "plan", "s", "use", "of", "the", "named", "selector", "with", "the", "replacement", ".", "to", "this", "plan", "node", ".", "This", "method", "does", "nothing", "if", "either", "of", "the", "supplied", "selector", "names", "is", "null", ...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L872-L881
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.findAllFirstNodesAtOrBelow
public List<PlanNode> findAllFirstNodesAtOrBelow( Type typeToFind ) { List<PlanNode> results = new LinkedList<PlanNode>(); LinkedList<PlanNode> queue = new LinkedList<PlanNode>(); queue.add(this); while (!queue.isEmpty()) { PlanNode aNode = queue.poll(); if (aNode...
java
public List<PlanNode> findAllFirstNodesAtOrBelow( Type typeToFind ) { List<PlanNode> results = new LinkedList<PlanNode>(); LinkedList<PlanNode> queue = new LinkedList<PlanNode>(); queue.add(this); while (!queue.isEmpty()) { PlanNode aNode = queue.poll(); if (aNode...
[ "public", "List", "<", "PlanNode", ">", "findAllFirstNodesAtOrBelow", "(", "Type", "typeToFind", ")", "{", "List", "<", "PlanNode", ">", "results", "=", "new", "LinkedList", "<", "PlanNode", ">", "(", ")", ";", "LinkedList", "<", "PlanNode", ">", "queue", ...
Look at nodes below this node, searching for nodes that have the supplied type. As soon as a node with a matching type is found, then no other nodes below it are searched. @param typeToFind the type of node to find; may not be null @return the collection of nodes that are at or below this node that all have the suppli...
[ "Look", "at", "nodes", "below", "this", "node", "searching", "for", "nodes", "that", "have", "the", "supplied", "type", ".", "As", "soon", "as", "a", "node", "with", "a", "matching", "type", "is", "found", "then", "no", "other", "nodes", "below", "it", ...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1150-L1163
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.apply
public void apply( Traversal order, final Operation operation, final Type type ) { apply(order, new Operation() { @Override public void apply( PlanNode node ) { if (node.getType() == type) operation.apply(node); } ...
java
public void apply( Traversal order, final Operation operation, final Type type ) { apply(order, new Operation() { @Override public void apply( PlanNode node ) { if (node.getType() == type) operation.apply(node); } ...
[ "public", "void", "apply", "(", "Traversal", "order", ",", "final", "Operation", "operation", ",", "final", "Type", "type", ")", "{", "apply", "(", "order", ",", "new", "Operation", "(", ")", "{", "@", "Override", "public", "void", "apply", "(", "PlanNod...
Walk the plan tree starting in the specified traversal order, and apply the supplied operation to every plan node with a type that matches the given type. @param order the order in which the subtree should be traversed; may not be null @param operation the operation that should be applied; may not be null @param type ...
[ "Walk", "the", "plan", "tree", "starting", "in", "the", "specified", "traversal", "order", "and", "apply", "the", "supplied", "operation", "to", "every", "plan", "node", "with", "a", "type", "that", "matches", "the", "given", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1188-L1197
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.apply
public void apply( Traversal order, Operation operation ) { assert order != null; switch (order) { case LEVEL_ORDER: operation.apply(this); applyLevelOrder(order, operation); break; case PRE_ORDER: ...
java
public void apply( Traversal order, Operation operation ) { assert order != null; switch (order) { case LEVEL_ORDER: operation.apply(this); applyLevelOrder(order, operation); break; case PRE_ORDER: ...
[ "public", "void", "apply", "(", "Traversal", "order", ",", "Operation", "operation", ")", "{", "assert", "order", "!=", "null", ";", "switch", "(", "order", ")", "{", "case", "LEVEL_ORDER", ":", "operation", ".", "apply", "(", "this", ")", ";", "applyLev...
Walk the plan tree starting in the specified traversal order, and apply the supplied operation to every plan node. @param order the order in which the subtree should be traversed; may not be null @param operation the operation that should be applied; may not be null
[ "Walk", "the", "plan", "tree", "starting", "in", "the", "specified", "traversal", "order", "and", "apply", "the", "supplied", "operation", "to", "every", "plan", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1240-L1261
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.applyToAncestorsUpTo
public void applyToAncestorsUpTo( Type stopType, Operation operation ) { PlanNode ancestor = getParent(); while (ancestor != null) { if (ancestor.getType() == stopType) return; operation.apply(ancestor); ancestor = ancestor.getPar...
java
public void applyToAncestorsUpTo( Type stopType, Operation operation ) { PlanNode ancestor = getParent(); while (ancestor != null) { if (ancestor.getType() == stopType) return; operation.apply(ancestor); ancestor = ancestor.getPar...
[ "public", "void", "applyToAncestorsUpTo", "(", "Type", "stopType", ",", "Operation", "operation", ")", "{", "PlanNode", "ancestor", "=", "getParent", "(", ")", ";", "while", "(", "ancestor", "!=", "null", ")", "{", "if", "(", "ancestor", ".", "getType", "(...
Apply the operation to all ancestor nodes below a node of the given type. @param stopType the type of node that should not be included in the results; may not be null @param operation the operation to apply to each of the ancestor nodes below the given type; may not be null
[ "Apply", "the", "operation", "to", "all", "ancestor", "nodes", "below", "a", "node", "of", "the", "given", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1279-L1287
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.applyToAncestors
public void applyToAncestors( Operation operation ) { PlanNode ancestor = getParent(); while (ancestor != null) { operation.apply(ancestor); ancestor = ancestor.getParent(); } }
java
public void applyToAncestors( Operation operation ) { PlanNode ancestor = getParent(); while (ancestor != null) { operation.apply(ancestor); ancestor = ancestor.getParent(); } }
[ "public", "void", "applyToAncestors", "(", "Operation", "operation", ")", "{", "PlanNode", "ancestor", "=", "getParent", "(", ")", ";", "while", "(", "ancestor", "!=", "null", ")", "{", "operation", ".", "apply", "(", "ancestor", ")", ";", "ancestor", "=",...
Apply the operation to all ancestor nodes. @param operation the operation to apply to each of the ancestor nodes; may not be null
[ "Apply", "the", "operation", "to", "all", "ancestor", "nodes", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1294-L1300
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.findAllAtOrBelow
public List<PlanNode> findAllAtOrBelow( Traversal order ) { assert order != null; LinkedList<PlanNode> results = new LinkedList<PlanNode>(); LinkedList<PlanNode> queue = new LinkedList<PlanNode>(); queue.add(this); while (!queue.isEmpty()) { PlanNode aNode = queue.pol...
java
public List<PlanNode> findAllAtOrBelow( Traversal order ) { assert order != null; LinkedList<PlanNode> results = new LinkedList<PlanNode>(); LinkedList<PlanNode> queue = new LinkedList<PlanNode>(); queue.add(this); while (!queue.isEmpty()) { PlanNode aNode = queue.pol...
[ "public", "List", "<", "PlanNode", ">", "findAllAtOrBelow", "(", "Traversal", "order", ")", "{", "assert", "order", "!=", "null", ";", "LinkedList", "<", "PlanNode", ">", "results", "=", "new", "LinkedList", "<", "PlanNode", ">", "(", ")", ";", "LinkedList...
Find all of the nodes that are at or below this node. @param order the order to traverse; may not be null @return the collection of nodes that are at or below this node; never null and never empty
[ "Find", "all", "of", "the", "nodes", "that", "are", "at", "or", "below", "this", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1317-L1340
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.findAllAtOrBelow
public List<PlanNode> findAllAtOrBelow( Traversal order, Type typeToFind ) { return findAllAtOrBelow(order, EnumSet.of(typeToFind)); }
java
public List<PlanNode> findAllAtOrBelow( Traversal order, Type typeToFind ) { return findAllAtOrBelow(order, EnumSet.of(typeToFind)); }
[ "public", "List", "<", "PlanNode", ">", "findAllAtOrBelow", "(", "Traversal", "order", ",", "Type", "typeToFind", ")", "{", "return", "findAllAtOrBelow", "(", "order", ",", "EnumSet", ".", "of", "(", "typeToFind", ")", ")", ";", "}" ]
Find all of the nodes of the specified type that are at or below this node. @param order the order to traverse; may not be null @param typeToFind the type of node to find; may not be null @return the collection of nodes that are at or below this node that all have the supplied type; never null but possibly empty
[ "Find", "all", "of", "the", "nodes", "of", "the", "specified", "type", "that", "are", "at", "or", "below", "this", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1385-L1388
train
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.findAtOrBelow
public PlanNode findAtOrBelow( Traversal order, Type typeToFind ) { return findAtOrBelow(order, EnumSet.of(typeToFind)); }
java
public PlanNode findAtOrBelow( Traversal order, Type typeToFind ) { return findAtOrBelow(order, EnumSet.of(typeToFind)); }
[ "public", "PlanNode", "findAtOrBelow", "(", "Traversal", "order", ",", "Type", "typeToFind", ")", "{", "return", "findAtOrBelow", "(", "order", ",", "EnumSet", ".", "of", "(", "typeToFind", ")", ")", ";", "}" ]
Find the first node with the specified type that are at or below this node. @param order the order to traverse; may not be null @param typeToFind the type of node to find; may not be null @return the first node that is at or below this node that has the supplied type; or null if there is no such node
[ "Find", "the", "first", "node", "with", "the", "specified", "type", "that", "are", "at", "or", "below", "this", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1484-L1487
train
ModeShape/modeshape
connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/Nodes.java
Nodes.findJcrName
public String findJcrName( String cmisName ) { for (Relation aList : list) { if (aList.cmisName.equals(cmisName)) { return aList.jcrName; } } return cmisName; }
java
public String findJcrName( String cmisName ) { for (Relation aList : list) { if (aList.cmisName.equals(cmisName)) { return aList.jcrName; } } return cmisName; }
[ "public", "String", "findJcrName", "(", "String", "cmisName", ")", "{", "for", "(", "Relation", "aList", ":", "list", ")", "{", "if", "(", "aList", ".", "cmisName", ".", "equals", "(", "cmisName", ")", ")", "{", "return", "aList", ".", "jcrName", ";", ...
Gets the name of the given property in JCR domain. @param cmisName the name of the given property in CMIS domain. @return the name of the given property in JCR domain.
[ "Gets", "the", "name", "of", "the", "given", "property", "in", "JCR", "domain", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/Nodes.java#L40-L47
train
ModeShape/modeshape
connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/Nodes.java
Nodes.findCmisName
public String findCmisName( String jcrName ) { for (Relation aList : list) { if (aList.jcrName.equals(jcrName)) { return aList.cmisName; } } return jcrName; }
java
public String findCmisName( String jcrName ) { for (Relation aList : list) { if (aList.jcrName.equals(jcrName)) { return aList.cmisName; } } return jcrName; }
[ "public", "String", "findCmisName", "(", "String", "jcrName", ")", "{", "for", "(", "Relation", "aList", ":", "list", ")", "{", "if", "(", "aList", ".", "jcrName", ".", "equals", "(", "jcrName", ")", ")", "{", "return", "aList", ".", "cmisName", ";", ...
Gets the name of the given property in CMIS domain. @param jcrName the name of the given property in JCR domain. @return the name of the given property in CMIS domain.
[ "Gets", "the", "name", "of", "the", "given", "property", "in", "CMIS", "domain", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/Nodes.java#L55-L62
train