id
int32
0
165k
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
56,000
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
56,001
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
56,002
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
56,003
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
56,004
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
56,005
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
56,006
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
56,007
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
56,008
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
56,009
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
56,010
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
56,011
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
56,012
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
56,013
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
56,014
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
56,015
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
56,016
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
56,017
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
56,018
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
56,019
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
56,020
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
56,021
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
56,022
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
56,023
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
56,024
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
56,025
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
56,026
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
56,027
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
56,028
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
56,029
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
56,030
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
56,031
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
56,032
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
56,033
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
56,034
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
56,035
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
56,036
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
56,037
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
56,038
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
56,039
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
56,040
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
56,041
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
56,042
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
56,043
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
56,044
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
56,045
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
56,046
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
56,047
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
56,048
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
56,049
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
56,050
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
56,051
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
56,052
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
56,053
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java
FullTextSearchParser.parse
public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); ...
java
public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); ...
[ "public", "Term", "parse", "(", "String", "fullTextSearchExpression", ")", "{", "CheckArg", ".", "isNotNull", "(", "fullTextSearchExpression", ",", "\"fullTextSearchExpression\"", ")", ";", "Tokenizer", "tokenizer", "=", "new", "TermTokenizer", "(", ")", ";", "Token...
Parse the full-text search criteria given in the supplied string. @param fullTextSearchExpression the full-text search expression; may not be null @return the term representation of the full-text search, or null if there are no terms @throws ParsingException if there is an error parsing the supplied string @throws Ill...
[ "Parse", "the", "full", "-", "text", "search", "criteria", "given", "in", "the", "supplied", "string", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java#L121-L126
56,054
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java
FullTextSearchParser.parse
public Term parse( TokenStream tokens ) { CheckArg.isNotNull(tokens, "tokens"); List<Term> terms = new ArrayList<Term>(); do { Term term = parseDisjunctedTerms(tokens); if (term == null) break; terms.add(term); } while (tokens.canConsume("OR")); ...
java
public Term parse( TokenStream tokens ) { CheckArg.isNotNull(tokens, "tokens"); List<Term> terms = new ArrayList<Term>(); do { Term term = parseDisjunctedTerms(tokens); if (term == null) break; terms.add(term); } while (tokens.canConsume("OR")); ...
[ "public", "Term", "parse", "(", "TokenStream", "tokens", ")", "{", "CheckArg", ".", "isNotNull", "(", "tokens", ",", "\"tokens\"", ")", ";", "List", "<", "Term", ">", "terms", "=", "new", "ArrayList", "<", "Term", ">", "(", ")", ";", "do", "{", "Term...
Parse the full-text search criteria from the supplied token stream. This method is useful when the full-text search expression is included in other content. @param tokens the token stream containing the full-text search starting on the next token @return the term representation of the full-text search, or null if ther...
[ "Parse", "the", "full", "-", "text", "search", "criteria", "from", "the", "supplied", "token", "stream", ".", "This", "method", "is", "useful", "when", "the", "full", "-", "text", "search", "expression", "is", "included", "in", "other", "content", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/FullTextSearchParser.java#L137-L147
56,055
ModeShape/modeshape
persistence/modeshape-persistence-relational/src/main/java/org/modeshape/persistence/relational/TransactionsHolder.java
TransactionsHolder.requireActiveTransaction
protected static String requireActiveTransaction() { return Optional.ofNullable(ACTIVE_TX_ID.get()).orElseThrow(() -> new RelationalProviderException( RelationalProviderI18n.threadNotAssociatedWithTransaction, Thread.currentThread().getName())); }
java
protected static String requireActiveTransaction() { return Optional.ofNullable(ACTIVE_TX_ID.get()).orElseThrow(() -> new RelationalProviderException( RelationalProviderI18n.threadNotAssociatedWithTransaction, Thread.currentThread().getName())); }
[ "protected", "static", "String", "requireActiveTransaction", "(", ")", "{", "return", "Optional", ".", "ofNullable", "(", "ACTIVE_TX_ID", ".", "get", "(", ")", ")", ".", "orElseThrow", "(", "(", ")", "->", "new", "RelationalProviderException", "(", "RelationalPr...
Requires that an active transaction exists for the current calling thread. @return the ID of the active transaction, never {@code null} @throws RelationalProviderException if the current thread is not associated with a transaction.
[ "Requires", "that", "an", "active", "transaction", "exists", "for", "the", "current", "calling", "thread", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/persistence/modeshape-persistence-relational/src/main/java/org/modeshape/persistence/relational/TransactionsHolder.java#L45-L49
56,056
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.emptySequence
public static NodeSequence emptySequence( final int width ) { assert width >= 0; return new NodeSequence() { @Override public int width() { return width; } @Override public Batch nextBatch() { return null; ...
java
public static NodeSequence emptySequence( final int width ) { assert width >= 0; return new NodeSequence() { @Override public int width() { return width; } @Override public Batch nextBatch() { return null; ...
[ "public", "static", "NodeSequence", "emptySequence", "(", "final", "int", "width", ")", "{", "assert", "width", ">=", "0", ";", "return", "new", "NodeSequence", "(", ")", "{", "@", "Override", "public", "int", "width", "(", ")", "{", "return", "width", "...
Get an empty node sequence. @param width the width of the batches; must be positive @return the empty node sequence; never null
[ "Get", "an", "empty", "node", "sequence", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L184-L216
56,057
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.emptyBatch
public static Batch emptyBatch( final String workspaceName, final int width ) { assert width > 0; return new Batch() { @Override public boolean hasNext() { return false; } @Override public St...
java
public static Batch emptyBatch( final String workspaceName, final int width ) { assert width > 0; return new Batch() { @Override public boolean hasNext() { return false; } @Override public St...
[ "public", "static", "Batch", "emptyBatch", "(", "final", "String", "workspaceName", ",", "final", "int", "width", ")", "{", "assert", "width", ">", "0", ";", "return", "new", "Batch", "(", ")", "{", "@", "Override", "public", "boolean", "hasNext", "(", "...
Get a batch of nodes that is empty. @param workspaceName the name of the workspace @param width the width of the batch; must be positive @return the empty node batch; never null
[ "Get", "a", "batch", "of", "nodes", "that", "is", "empty", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L225-L284
56,058
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.withBatch
public static NodeSequence withBatch( final Batch sequence ) { if (sequence == null) return emptySequence(1); return new NodeSequence() { private boolean done = false; @Override public int width() { return sequence.width(); } ...
java
public static NodeSequence withBatch( final Batch sequence ) { if (sequence == null) return emptySequence(1); return new NodeSequence() { private boolean done = false; @Override public int width() { return sequence.width(); } ...
[ "public", "static", "NodeSequence", "withBatch", "(", "final", "Batch", "sequence", ")", "{", "if", "(", "sequence", "==", "null", ")", "return", "emptySequence", "(", "1", ")", ";", "return", "new", "NodeSequence", "(", ")", "{", "private", "boolean", "do...
Create a sequence of nodes that returns the supplied single batch of nodes. @param sequence the node keys to be returned; if null, an {@link #emptySequence empty instance} is returned @return the sequence of nodes; never null
[ "Create", "a", "sequence", "of", "nodes", "that", "returns", "the", "supplied", "single", "batch", "of", "nodes", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L292-L328
56,059
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.limit
public static NodeSequence limit( NodeSequence sequence, Limit limitAndOffset ) { if (sequence == null) return emptySequence(0); if (limitAndOffset != null && !limitAndOffset.isUnlimited()) { final int limit = limitAndOffset.getRowLimit(); //...
java
public static NodeSequence limit( NodeSequence sequence, Limit limitAndOffset ) { if (sequence == null) return emptySequence(0); if (limitAndOffset != null && !limitAndOffset.isUnlimited()) { final int limit = limitAndOffset.getRowLimit(); //...
[ "public", "static", "NodeSequence", "limit", "(", "NodeSequence", "sequence", ",", "Limit", "limitAndOffset", ")", "{", "if", "(", "sequence", "==", "null", ")", "return", "emptySequence", "(", "0", ")", ";", "if", "(", "limitAndOffset", "!=", "null", "&&", ...
Create a sequence of nodes that skips a specified number of nodes before returning any nodes and that limits the number of nodes returned. @param sequence the original sequence that is to be limited; may be null @param limitAndOffset the specification of the offset and limit; if null this method simply returns <code>s...
[ "Create", "a", "sequence", "of", "nodes", "that", "skips", "a", "specified", "number", "of", "nodes", "before", "returning", "any", "nodes", "and", "that", "limits", "the", "number", "of", "nodes", "returned", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L619-L634
56,060
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.limit
public static NodeSequence limit( final NodeSequence sequence, final long maxRows ) { if (sequence == null) return emptySequence(0); if (maxRows <= 0) return emptySequence(sequence.width()); if (sequence.isEmpty()) return sequence; return new NodeSeq...
java
public static NodeSequence limit( final NodeSequence sequence, final long maxRows ) { if (sequence == null) return emptySequence(0); if (maxRows <= 0) return emptySequence(sequence.width()); if (sequence.isEmpty()) return sequence; return new NodeSeq...
[ "public", "static", "NodeSequence", "limit", "(", "final", "NodeSequence", "sequence", ",", "final", "long", "maxRows", ")", "{", "if", "(", "sequence", "==", "null", ")", "return", "emptySequence", "(", "0", ")", ";", "if", "(", "maxRows", "<=", "0", ")...
Create a sequence of nodes that returns at most the supplied number of rows. @param sequence the original sequence that is to be limited; may be null @param maxRows the maximum number of rows that are to be returned by the sequence; should be positive or this method simply returns <code>sequence</code> @return the seq...
[ "Create", "a", "sequence", "of", "nodes", "that", "returns", "at", "most", "the", "supplied", "number", "of", "rows", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L644-L713
56,061
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.skip
public static NodeSequence skip( final NodeSequence sequence, final int skip ) { if (sequence == null) return emptySequence(0); if (skip <= 0 || sequence.isEmpty()) return sequence; return new NodeSequence() { private int rowsToSkip = skip; ...
java
public static NodeSequence skip( final NodeSequence sequence, final int skip ) { if (sequence == null) return emptySequence(0); if (skip <= 0 || sequence.isEmpty()) return sequence; return new NodeSequence() { private int rowsToSkip = skip; ...
[ "public", "static", "NodeSequence", "skip", "(", "final", "NodeSequence", "sequence", ",", "final", "int", "skip", ")", "{", "if", "(", "sequence", "==", "null", ")", "return", "emptySequence", "(", "0", ")", ";", "if", "(", "skip", "<=", "0", "||", "s...
Create a sequence of nodes that skips a specified number of rows before returning any rows. @param sequence the original sequence that is to be limited; may be null @param skip the number of initial rows that should be skipped; should be positive or this method simply returns <code>sequence</code> @return the sequence...
[ "Create", "a", "sequence", "of", "nodes", "that", "skips", "a", "specified", "number", "of", "rows", "before", "returning", "any", "rows", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L723-L797
56,062
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.filter
public static NodeSequence filter( final NodeSequence sequence, final RowFilter filter ) { if (sequence == null) return emptySequence(0); if (filter == null || sequence.isEmpty()) return sequence; return new NodeSequence() { @Override ...
java
public static NodeSequence filter( final NodeSequence sequence, final RowFilter filter ) { if (sequence == null) return emptySequence(0); if (filter == null || sequence.isEmpty()) return sequence; return new NodeSequence() { @Override ...
[ "public", "static", "NodeSequence", "filter", "(", "final", "NodeSequence", "sequence", ",", "final", "RowFilter", "filter", ")", "{", "if", "(", "sequence", "==", "null", ")", "return", "emptySequence", "(", "0", ")", ";", "if", "(", "filter", "==", "null...
Create a sequence of nodes that all satisfy the supplied filter. @param sequence the original sequence that is to be limited; may be null @param filter the filter to apply to the nodes; if null this method simply returns <code>sequence</code> @return the sequence of filtered nodes; never null
[ "Create", "a", "sequence", "of", "nodes", "that", "all", "satisfy", "the", "supplied", "filter", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L947-L986
56,063
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.append
public static NodeSequence append( final NodeSequence first, final NodeSequence second ) { if (first == null) { return second != null ? second : emptySequence(0); } if (second == null) return first; int firstWidth = first.width(); ...
java
public static NodeSequence append( final NodeSequence first, final NodeSequence second ) { if (first == null) { return second != null ? second : emptySequence(0); } if (second == null) return first; int firstWidth = first.width(); ...
[ "public", "static", "NodeSequence", "append", "(", "final", "NodeSequence", "first", ",", "final", "NodeSequence", "second", ")", "{", "if", "(", "first", "==", "null", ")", "{", "return", "second", "!=", "null", "?", "second", ":", "emptySequence", "(", "...
Create a sequence of nodes that contains the nodes from the first sequence followed by the second sequence. @param first the first sequence; may be null @param second the second sequence; may be null @return the new combined sequence; never null @throws IllegalArgumentException if the sequences have different widths
[ "Create", "a", "sequence", "of", "nodes", "that", "contains", "the", "nodes", "from", "the", "first", "sequence", "followed", "by", "the", "second", "sequence", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L996-L1054
56,064
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.slice
public static NodeSequence slice( final NodeSequence original, Columns columns ) { final int newWidth = columns.getSelectorNames().size(); if (original.width() == newWidth) { return original; } // We need to return a NodeSequence that inc...
java
public static NodeSequence slice( final NodeSequence original, Columns columns ) { final int newWidth = columns.getSelectorNames().size(); if (original.width() == newWidth) { return original; } // We need to return a NodeSequence that inc...
[ "public", "static", "NodeSequence", "slice", "(", "final", "NodeSequence", "original", ",", "Columns", "columns", ")", "{", "final", "int", "newWidth", "=", "columns", ".", "getSelectorNames", "(", ")", ".", "size", "(", ")", ";", "if", "(", "original", "....
Create a sequence of nodes that include only those selectors defined by the given columns. @param original the original node sequence that might have more selectors than specified by the columns @param columns the columns defining the selectors that are to be exposed @return the node sequence; never null but possibly ...
[ "Create", "a", "sequence", "of", "nodes", "that", "include", "only", "those", "selectors", "defined", "by", "the", "given", "columns", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1063-L1111
56,065
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.merging
public static NodeSequence merging( final NodeSequence first, final NodeSequence second, final int totalWidth ) { if (first == null) { if (second == null) return emptySequence(totalWidth); final int firstWidt...
java
public static NodeSequence merging( final NodeSequence first, final NodeSequence second, final int totalWidth ) { if (first == null) { if (second == null) return emptySequence(totalWidth); final int firstWidt...
[ "public", "static", "NodeSequence", "merging", "(", "final", "NodeSequence", "first", ",", "final", "NodeSequence", "second", ",", "final", "int", "totalWidth", ")", "{", "if", "(", "first", "==", "null", ")", "{", "if", "(", "second", "==", "null", ")", ...
Create a sequence of nodes that merges the two supplied sequences. @param first the first sequence; may be null @param second the second sequence; may be null @param totalWidth the total width of the sequences; should be equal to <code>first.getWidth() + second.getWidth()</code> @return the new merged sequence; never ...
[ "Create", "a", "sequence", "of", "nodes", "that", "merges", "the", "two", "supplied", "sequences", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1184-L1301
56,066
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.initialize
public synchronized final void initialize() throws RepositoryException { if (!initialized) { try { doInitialize(); initialized = true; } catch (RuntimeException e) { throw new RepositoryException(e); } } }
java
public synchronized final void initialize() throws RepositoryException { if (!initialized) { try { doInitialize(); initialized = true; } catch (RuntimeException e) { throw new RepositoryException(e); } } }
[ "public", "synchronized", "final", "void", "initialize", "(", ")", "throws", "RepositoryException", "{", "if", "(", "!", "initialized", ")", "{", "try", "{", "doInitialize", "(", ")", ";", "initialized", "=", "true", ";", "}", "catch", "(", "RuntimeException...
Initialize the provider. This is called automatically by ModeShape once for each provider instance, and should not be called by the provider itself. @throws RepositoryException if there is a problem initializing the provider
[ "Initialize", "the", "provider", ".", "This", "is", "called", "automatically", "by", "ModeShape", "once", "for", "each", "provider", "instance", "and", "should", "not", "be", "called", "by", "the", "provider", "itself", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L301-L310
56,067
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.shutdown
public synchronized final void shutdown() throws RepositoryException { preShutdown(); delegateWriter = NoOpQueryIndexWriter.INSTANCE; try { // Shutdown each of the provided indexes ... for (Map<String, AtomicIndex> byWorkspaceName : providedIndexesByWorkspaceNameByIndexN...
java
public synchronized final void shutdown() throws RepositoryException { preShutdown(); delegateWriter = NoOpQueryIndexWriter.INSTANCE; try { // Shutdown each of the provided indexes ... for (Map<String, AtomicIndex> byWorkspaceName : providedIndexesByWorkspaceNameByIndexN...
[ "public", "synchronized", "final", "void", "shutdown", "(", ")", "throws", "RepositoryException", "{", "preShutdown", "(", ")", ";", "delegateWriter", "=", "NoOpQueryIndexWriter", ".", "INSTANCE", ";", "try", "{", "// Shutdown each of the provided indexes ...", "for", ...
Signal this provider that it is no longer needed and can release any resources that are being held. @throws RepositoryException if there is a problem shutting down the provider
[ "Signal", "this", "provider", "that", "it", "is", "no", "longer", "needed", "and", "can", "release", "any", "resources", "that", "are", "being", "held", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L348-L364
56,068
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.validateDefaultColumnTypes
public void validateDefaultColumnTypes( ExecutionContext context, IndexDefinition defn, Problems problems ) { assert defn != null; for (int i = 0; i < defn.size(); i++) { validateDefaultColumnDefinitionTy...
java
public void validateDefaultColumnTypes( ExecutionContext context, IndexDefinition defn, Problems problems ) { assert defn != null; for (int i = 0; i < defn.size(); i++) { validateDefaultColumnDefinitionTy...
[ "public", "void", "validateDefaultColumnTypes", "(", "ExecutionContext", "context", ",", "IndexDefinition", "defn", ",", "Problems", "problems", ")", "{", "assert", "defn", "!=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "defn", ".", "s...
Validates that if certain default columns are present in the index definition, they have a required type. @param context the execution context in which to perform the validation; never null @param defn the proposed index definition; never null @param problems the component to record any problems, errors, or warnings; ...
[ "Validates", "that", "if", "certain", "default", "columns", "are", "present", "in", "the", "index", "definition", "they", "have", "a", "required", "type", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L434-L441
56,069
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.getIndex
public final Index getIndex( String indexName, String workspaceName ) { logger().trace("Looking for index '{0}' in '{1}' provider for query in workspace '{2}'", indexName, getName(), workspaceName); Map<String, AtomicIndex> byWorkspaceNames = provi...
java
public final Index getIndex( String indexName, String workspaceName ) { logger().trace("Looking for index '{0}' in '{1}' provider for query in workspace '{2}'", indexName, getName(), workspaceName); Map<String, AtomicIndex> byWorkspaceNames = provi...
[ "public", "final", "Index", "getIndex", "(", "String", "indexName", ",", "String", "workspaceName", ")", "{", "logger", "(", ")", ".", "trace", "(", "\"Looking for index '{0}' in '{1}' provider for query in workspace '{2}'\"", ",", "indexName", ",", "getName", "(", ")...
Get the queryable index with the given name and applicable for the given workspace. @param indexName the name of the index in this provider; never null @param workspaceName the name of the workspace; never null @return the queryable index, or null if there is no such index
[ "Get", "the", "queryable", "index", "with", "the", "given", "name", "and", "applicable", "for", "the", "given", "workspace", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L525-L531
56,070
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.getManagedIndex
public final ManagedIndex getManagedIndex( String indexName, String workspaceName ) { logger().trace("Looking for managed index '{0}' in '{1}' provider in workspace '{2}'", indexName, getName(), workspaceName); Map<String, AtomicIndex...
java
public final ManagedIndex getManagedIndex( String indexName, String workspaceName ) { logger().trace("Looking for managed index '{0}' in '{1}' provider in workspace '{2}'", indexName, getName(), workspaceName); Map<String, AtomicIndex...
[ "public", "final", "ManagedIndex", "getManagedIndex", "(", "String", "indexName", ",", "String", "workspaceName", ")", "{", "logger", "(", ")", ".", "trace", "(", "\"Looking for managed index '{0}' in '{1}' provider in workspace '{2}'\"", ",", "indexName", ",", "getName",...
Get the managed index with the given name and applicable for the given workspace. @param indexName the name of the index in this provider; never null @param workspaceName the name of the workspace; never null @return the managed index, or null if there is no such index
[ "Get", "the", "managed", "index", "with", "the", "given", "name", "and", "applicable", "for", "the", "given", "workspace", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L540-L550
56,071
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.onEachIndex
private final void onEachIndex( ProvidedIndexOperation op ) { for (String workspaceName : workspaceNames()) { Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName); if (indexes != null) { for (AtomicIndex atomicIndex : indexes) { assert a...
java
private final void onEachIndex( ProvidedIndexOperation op ) { for (String workspaceName : workspaceNames()) { Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName); if (indexes != null) { for (AtomicIndex atomicIndex : indexes) { assert a...
[ "private", "final", "void", "onEachIndex", "(", "ProvidedIndexOperation", "op", ")", "{", "for", "(", "String", "workspaceName", ":", "workspaceNames", "(", ")", ")", "{", "Collection", "<", "AtomicIndex", ">", "indexes", "=", "providedIndexesFor", "(", "workspa...
Perform the specified operation on each of the managed indexes. @param op the operation; may not be null
[ "Perform", "the", "specified", "operation", "on", "each", "of", "the", "managed", "indexes", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L597-L608
56,072
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.onEachIndexInWorkspace
public final void onEachIndexInWorkspace( String workspaceName, ManagedIndexOperation op ) { assert workspaceName != null; Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName); if (indexes != null) { for (AtomicIndex atomic...
java
public final void onEachIndexInWorkspace( String workspaceName, ManagedIndexOperation op ) { assert workspaceName != null; Collection<AtomicIndex> indexes = providedIndexesFor(workspaceName); if (indexes != null) { for (AtomicIndex atomic...
[ "public", "final", "void", "onEachIndexInWorkspace", "(", "String", "workspaceName", ",", "ManagedIndexOperation", "op", ")", "{", "assert", "workspaceName", "!=", "null", ";", "Collection", "<", "AtomicIndex", ">", "indexes", "=", "providedIndexesFor", "(", "worksp...
Perform the specified operation on each of the managed indexes in the named workspace. @param workspaceName the name of the workspace; may not be null @param op the operation; may not be null
[ "Perform", "the", "specified", "operation", "on", "each", "of", "the", "managed", "indexes", "in", "the", "named", "workspace", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L628-L639
56,073
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java
IndexProvider.updateIndex
protected ManagedIndex updateIndex( IndexDefinition oldDefn, IndexDefinition updatedDefn, ManagedIndex existingIndex, String workspaceName, NodeTypes.Supplier n...
java
protected ManagedIndex updateIndex( IndexDefinition oldDefn, IndexDefinition updatedDefn, ManagedIndex existingIndex, String workspaceName, NodeTypes.Supplier n...
[ "protected", "ManagedIndex", "updateIndex", "(", "IndexDefinition", "oldDefn", ",", "IndexDefinition", "updatedDefn", ",", "ManagedIndex", "existingIndex", ",", "String", "workspaceName", ",", "NodeTypes", ".", "Supplier", "nodeTypesSupplier", ",", "NodeTypePredicate", "m...
Method called when this provider needs to update an existing index given the unique pair of workspace name and index definition. An index definition can apply to multiple workspaces, and when it is changed this method will be called once for each applicable workspace. <p> Providers may either choose to implement this ...
[ "Method", "called", "when", "this", "provider", "needs", "to", "update", "an", "existing", "index", "given", "the", "unique", "pair", "of", "workspace", "name", "and", "index", "definition", ".", "An", "index", "definition", "can", "apply", "to", "multiple", ...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexProvider.java#L1309-L1327
56,074
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/SystemContent.java
SystemContent.readAllNodeTypes
public List<NodeTypeDefinition> readAllNodeTypes() { CachedNode nodeTypes = nodeTypesNode(); List<NodeTypeDefinition> defns = new ArrayList<NodeTypeDefinition>(); for (ChildReference ref : nodeTypes.getChildReferences(system)) { CachedNode nodeType = system.getNode(ref); ...
java
public List<NodeTypeDefinition> readAllNodeTypes() { CachedNode nodeTypes = nodeTypesNode(); List<NodeTypeDefinition> defns = new ArrayList<NodeTypeDefinition>(); for (ChildReference ref : nodeTypes.getChildReferences(system)) { CachedNode nodeType = system.getNode(ref); ...
[ "public", "List", "<", "NodeTypeDefinition", ">", "readAllNodeTypes", "(", ")", "{", "CachedNode", "nodeTypes", "=", "nodeTypesNode", "(", ")", ";", "List", "<", "NodeTypeDefinition", ">", "defns", "=", "new", "ArrayList", "<", "NodeTypeDefinition", ">", "(", ...
Read from system storage all of the node type definitions. @return the node types as read from the system storage
[ "Read", "from", "system", "storage", "all", "of", "the", "node", "type", "definitions", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/SystemContent.java#L788-L796
56,075
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/text/Position.java
Position.add
public Position add( Position position ) { if (this.getIndexInContent() < 0) { return position.getIndexInContent() < 0 ? EMPTY_CONTENT_POSITION : position; } if (position.getIndexInContent() < 0) { return this; } int index = this.getIndexInContent() + po...
java
public Position add( Position position ) { if (this.getIndexInContent() < 0) { return position.getIndexInContent() < 0 ? EMPTY_CONTENT_POSITION : position; } if (position.getIndexInContent() < 0) { return this; } int index = this.getIndexInContent() + po...
[ "public", "Position", "add", "(", "Position", "position", ")", "{", "if", "(", "this", ".", "getIndexInContent", "(", ")", "<", "0", ")", "{", "return", "position", ".", "getIndexInContent", "(", ")", "<", "0", "?", "EMPTY_CONTENT_POSITION", ":", "position...
Return a new position that is the addition of this position and that supplied. @param position the position to add to this object; may not be null @return the combined position
[ "Return", "a", "new", "position", "that", "is", "the", "addition", "of", "this", "position", "and", "that", "supplied", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/text/Position.java#L92-L106
56,076
ModeShape/modeshape
connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/ObjectId.java
ObjectId.valueOf
public static ObjectId valueOf( String uuid ) { int p = uuid.indexOf("/"); if (p < 0) { return new ObjectId(Type.OBJECT, uuid); } int p1 = p; while (p > 0) { p1 = p; p = uuid.indexOf("/", p + 1); } p = p1; ...
java
public static ObjectId valueOf( String uuid ) { int p = uuid.indexOf("/"); if (p < 0) { return new ObjectId(Type.OBJECT, uuid); } int p1 = p; while (p > 0) { p1 = p; p = uuid.indexOf("/", p + 1); } p = p1; ...
[ "public", "static", "ObjectId", "valueOf", "(", "String", "uuid", ")", "{", "int", "p", "=", "uuid", ".", "indexOf", "(", "\"/\"", ")", ";", "if", "(", "p", "<", "0", ")", "{", "return", "new", "ObjectId", "(", "Type", ".", "OBJECT", ",", "uuid", ...
Constructs instance of this class from its textual representation. @param uuid the textual representation of this object. @return object instance.
[ "Constructs", "instance", "of", "this", "class", "from", "its", "textual", "representation", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/ObjectId.java#L77-L94
56,077
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java
RepositoryConfiguration.replaceSystemPropertyVariables
protected static Document replaceSystemPropertyVariables( Document doc ) { if (doc.isEmpty()) return doc; Document modified = doc.withVariablesReplacedWithSystemProperties(); if (modified == doc) return doc; // Otherwise, we changed some values. Note that the system properties can only ...
java
protected static Document replaceSystemPropertyVariables( Document doc ) { if (doc.isEmpty()) return doc; Document modified = doc.withVariablesReplacedWithSystemProperties(); if (modified == doc) return doc; // Otherwise, we changed some values. Note that the system properties can only ...
[ "protected", "static", "Document", "replaceSystemPropertyVariables", "(", "Document", "doc", ")", "{", "if", "(", "doc", ".", "isEmpty", "(", ")", ")", "return", "doc", ";", "Document", "modified", "=", "doc", ".", "withVariablesReplacedWithSystemProperties", "(",...
Utility method to replace all system property variables found within the specified document. @param doc the document; may not be null @return the modified document if system property variables were found, or the <code>doc</code> instance if no such variables were found
[ "Utility", "method", "to", "replace", "all", "system", "property", "variables", "found", "within", "the", "specified", "document", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L753-L762
56,078
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java
RepositoryConfiguration.read
public static RepositoryConfiguration read( String resourcePathOrJsonContentString ) throws ParsingException, FileNotFoundException { CheckArg.isNotNull(resourcePathOrJsonContentString, "resourcePathOrJsonContentString"); InputStream stream = ResourceLookup.read(resourcePathOrJsonContentString, ...
java
public static RepositoryConfiguration read( String resourcePathOrJsonContentString ) throws ParsingException, FileNotFoundException { CheckArg.isNotNull(resourcePathOrJsonContentString, "resourcePathOrJsonContentString"); InputStream stream = ResourceLookup.read(resourcePathOrJsonContentString, ...
[ "public", "static", "RepositoryConfiguration", "read", "(", "String", "resourcePathOrJsonContentString", ")", "throws", "ParsingException", ",", "FileNotFoundException", "{", "CheckArg", ".", "isNotNull", "(", "resourcePathOrJsonContentString", ",", "\"resourcePathOrJsonContent...
Read the repository configuration given by the supplied path to a file on the file system, the path a classpath resource file, or a string containg the actual JSON content. @param resourcePathOrJsonContentString the path to a file on the file system, the path to a classpath resource file or the JSON content string; ma...
[ "Read", "the", "repository", "configuration", "given", "by", "the", "supplied", "path", "to", "a", "file", "on", "the", "file", "system", "the", "path", "a", "classpath", "resource", "file", "or", "a", "string", "containg", "the", "actual", "JSON", "content"...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L818-L839
56,079
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java
RepositoryConfiguration.getNodeTypes
public List<String> getNodeTypes() { List<String> result = new ArrayList<String>(); List<?> configuredNodeTypes = doc.getArray(FieldName.NODE_TYPES); if (configuredNodeTypes != null) { for (Object configuredNodeType : configuredNodeTypes) { result.add(configuredNodeT...
java
public List<String> getNodeTypes() { List<String> result = new ArrayList<String>(); List<?> configuredNodeTypes = doc.getArray(FieldName.NODE_TYPES); if (configuredNodeTypes != null) { for (Object configuredNodeType : configuredNodeTypes) { result.add(configuredNodeT...
[ "public", "List", "<", "String", ">", "getNodeTypes", "(", ")", "{", "List", "<", "String", ">", "result", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "List", "<", "?", ">", "configuredNodeTypes", "=", "doc", ".", "getArray", "(", "Fi...
Returns a list with the cnd files which should be loaded at startup. @return a {@code non-null} string list
[ "Returns", "a", "list", "with", "the", "cnd", "files", "which", "should", "be", "loaded", "at", "startup", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L997-L1008
56,080
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java
RepositoryConfiguration.getDefaultWorkspaceName
public String getDefaultWorkspaceName() { Document workspaces = doc.getDocument(FieldName.WORKSPACES); if (workspaces != null) { return workspaces.getString(FieldName.DEFAULT, Default.DEFAULT); } return Default.DEFAULT; }
java
public String getDefaultWorkspaceName() { Document workspaces = doc.getDocument(FieldName.WORKSPACES); if (workspaces != null) { return workspaces.getString(FieldName.DEFAULT, Default.DEFAULT); } return Default.DEFAULT; }
[ "public", "String", "getDefaultWorkspaceName", "(", ")", "{", "Document", "workspaces", "=", "doc", ".", "getDocument", "(", "FieldName", ".", "WORKSPACES", ")", ";", "if", "(", "workspaces", "!=", "null", ")", "{", "return", "workspaces", ".", "getString", ...
Get the name of the workspace that should be used for sessions where the client does not specify the name of the workspace. @return the default workspace name; never null
[ "Get", "the", "name", "of", "the", "workspace", "that", "should", "be", "used", "for", "sessions", "where", "the", "client", "does", "not", "specify", "the", "name", "of", "the", "workspace", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L1299-L1305
56,081
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java
RepositoryConfiguration.getIndexProviders
public List<Component> getIndexProviders() { Problems problems = new SimpleProblems(); List<Component> components = readComponents(doc, FieldName.INDEX_PROVIDERS, FieldName.CLASSNAME, INDEX_PROVIDER_ALIASES, problems); assert !problems.hasError...
java
public List<Component> getIndexProviders() { Problems problems = new SimpleProblems(); List<Component> components = readComponents(doc, FieldName.INDEX_PROVIDERS, FieldName.CLASSNAME, INDEX_PROVIDER_ALIASES, problems); assert !problems.hasError...
[ "public", "List", "<", "Component", ">", "getIndexProviders", "(", ")", "{", "Problems", "problems", "=", "new", "SimpleProblems", "(", ")", ";", "List", "<", "Component", ">", "components", "=", "readComponents", "(", "doc", ",", "FieldName", ".", "INDEX_PR...
Get the ordered list of index providers defined in the configuration. @return the immutable list of provider components; never null but possibly empty
[ "Get", "the", "ordered", "list", "of", "index", "providers", "defined", "in", "the", "configuration", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L1539-L1545
56,082
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java
RepositoryConfiguration.getDocumentOptimization
public DocumentOptimization getDocumentOptimization() { Document storage = doc.getDocument(FieldName.STORAGE); if (storage == null) { storage = Schematic.newDocument(); } return new DocumentOptimization(storage.getDocument(FieldName.DOCUMENT_OPTIMIZATION)); }
java
public DocumentOptimization getDocumentOptimization() { Document storage = doc.getDocument(FieldName.STORAGE); if (storage == null) { storage = Schematic.newDocument(); } return new DocumentOptimization(storage.getDocument(FieldName.DOCUMENT_OPTIMIZATION)); }
[ "public", "DocumentOptimization", "getDocumentOptimization", "(", ")", "{", "Document", "storage", "=", "doc", ".", "getDocument", "(", "FieldName", ".", "STORAGE", ")", ";", "if", "(", "storage", "==", "null", ")", "{", "storage", "=", "Schematic", ".", "ne...
Get the configuration for the document optimization for this repository. @return the document optimization configuration; never null
[ "Get", "the", "configuration", "for", "the", "document", "optimization", "for", "this", "repository", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java#L1940-L1946
56,083
ModeShape/modeshape
modeshape-schematic/src/main/java/org/modeshape/schematic/internal/io/BsonDataOutput.java
BsonDataOutput.writeTo
public void writeTo( WritableByteChannel channel ) throws IOException { int numberOfBytesToWrite = size; for (ByteBuffer buffer : buffers) { if (buffer == null) { // already flushed continue; } int numBytesInBuffer = Math.min(numberOfBy...
java
public void writeTo( WritableByteChannel channel ) throws IOException { int numberOfBytesToWrite = size; for (ByteBuffer buffer : buffers) { if (buffer == null) { // already flushed continue; } int numBytesInBuffer = Math.min(numberOfBy...
[ "public", "void", "writeTo", "(", "WritableByteChannel", "channel", ")", "throws", "IOException", "{", "int", "numberOfBytesToWrite", "=", "size", ";", "for", "(", "ByteBuffer", "buffer", ":", "buffers", ")", "{", "if", "(", "buffer", "==", "null", ")", "{",...
Write all content to the supplied channel. @param channel the channel to which the content is to be written. @throws IOException if there is a problem writing to the supplied stream
[ "Write", "all", "content", "to", "the", "supplied", "channel", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/internal/io/BsonDataOutput.java#L441-L455
56,084
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/Upgrades.java
Upgrades.applyUpgradesSince
public final int applyUpgradesSince( int lastId, Context resources ) { int lastUpgradeId = lastId; for (UpgradeOperation op : operations) { if (op.getId() <= lastId) continue; LOGGER.debug("Upgrade {0}: starting", op); op.apply...
java
public final int applyUpgradesSince( int lastId, Context resources ) { int lastUpgradeId = lastId; for (UpgradeOperation op : operations) { if (op.getId() <= lastId) continue; LOGGER.debug("Upgrade {0}: starting", op); op.apply...
[ "public", "final", "int", "applyUpgradesSince", "(", "int", "lastId", ",", "Context", "resources", ")", "{", "int", "lastUpgradeId", "=", "lastId", ";", "for", "(", "UpgradeOperation", "op", ":", "operations", ")", "{", "if", "(", "op", ".", "getId", "(", ...
Apply any upgrades that are more recent than identified by the last upgraded identifier. @param lastId the identifier of the last upgrade that was successfully run against the repository @param resources the resources for the repository @return the identifier of the last upgrade applied to the repository; may be the s...
[ "Apply", "any", "upgrades", "that", "are", "more", "recent", "than", "identified", "by", "the", "last", "upgraded", "identifier", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/Upgrades.java#L94-L105
56,085
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/ExtensionLogger.java
ExtensionLogger.getLogger
public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) { return new ExtensionLogger(Logger.getLogger(clazz)); }
java
public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) { return new ExtensionLogger(Logger.getLogger(clazz)); }
[ "public", "static", "org", ".", "modeshape", ".", "jcr", ".", "api", ".", "Logger", "getLogger", "(", "Class", "<", "?", ">", "clazz", ")", "{", "return", "new", "ExtensionLogger", "(", "Logger", ".", "getLogger", "(", "clazz", ")", ")", ";", "}" ]
Creates a new logger instance for the underlying class. @param clazz a {@link Class} instance; never null @return a {@link org.modeshape.jcr.api.Logger} implementation
[ "Creates", "a", "new", "logger", "instance", "for", "the", "underlying", "class", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ExtensionLogger.java#L43-L45
56,086
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java
EsIndex.createIndex
private void createIndex() { try { client.createIndex(name(), workspace, columns.mappings(workspace)); client.flush(name()); } catch (IOException e) { throw new EsIndexException(e); } }
java
private void createIndex() { try { client.createIndex(name(), workspace, columns.mappings(workspace)); client.flush(name()); } catch (IOException e) { throw new EsIndexException(e); } }
[ "private", "void", "createIndex", "(", ")", "{", "try", "{", "client", ".", "createIndex", "(", "name", "(", ")", ",", "workspace", ",", "columns", ".", "mappings", "(", "workspace", ")", ")", ";", "client", ".", "flush", "(", "name", "(", ")", ")", ...
Executes create index action.
[ "Executes", "create", "index", "action", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L91-L98
56,087
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java
EsIndex.find
private EsRequest find(String nodeKey) throws IOException { return client.getDocument(name(), workspace, nodeKey); }
java
private EsRequest find(String nodeKey) throws IOException { return client.getDocument(name(), workspace, nodeKey); }
[ "private", "EsRequest", "find", "(", "String", "nodeKey", ")", "throws", "IOException", "{", "return", "client", ".", "getDocument", "(", "name", "(", ")", ",", "workspace", ",", "nodeKey", ")", ";", "}" ]
Searches indexed node's properties by node key. @param nodeKey node key being indexed. @return list of stored properties as json document. @throws IOException
[ "Searches", "indexed", "node", "s", "properties", "by", "node", "key", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L184-L186
56,088
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java
EsIndex.findOrCreateDoc
private EsRequest findOrCreateDoc(String nodeKey) throws IOException { EsRequest doc = client.getDocument(name(), workspace, nodeKey); return doc != null ? doc : new EsRequest(); }
java
private EsRequest findOrCreateDoc(String nodeKey) throws IOException { EsRequest doc = client.getDocument(name(), workspace, nodeKey); return doc != null ? doc : new EsRequest(); }
[ "private", "EsRequest", "findOrCreateDoc", "(", "String", "nodeKey", ")", "throws", "IOException", "{", "EsRequest", "doc", "=", "client", ".", "getDocument", "(", "name", "(", ")", ",", "workspace", ",", "nodeKey", ")", ";", "return", "doc", "!=", "null", ...
Searches indexed node's properties by node key or creates new empty list. @param nodeKey node key being indexed. @return list of stored properties as json document or empty document if not found. @throws IOException
[ "Searches", "indexed", "node", "s", "properties", "by", "node", "key", "or", "creates", "new", "empty", "list", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L196-L199
56,089
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java
EsIndex.putValue
private void putValue(EsRequest doc, EsIndexColumn column, Object value) { Object columnValue = column.columnValue(value); String stringValue = column.stringValue(value); doc.put(column.getName(), columnValue); if (!(value instanceof ModeShapeDateTime || value instanceof Long || value in...
java
private void putValue(EsRequest doc, EsIndexColumn column, Object value) { Object columnValue = column.columnValue(value); String stringValue = column.stringValue(value); doc.put(column.getName(), columnValue); if (!(value instanceof ModeShapeDateTime || value instanceof Long || value in...
[ "private", "void", "putValue", "(", "EsRequest", "doc", ",", "EsIndexColumn", "column", ",", "Object", "value", ")", "{", "Object", "columnValue", "=", "column", ".", "columnValue", "(", "value", ")", ";", "String", "stringValue", "=", "column", ".", "string...
Appends specified value for the given column and related pseudo columns into list of properties. @param doc list of properties in json format @param column colum definition @param value column's value.
[ "Appends", "specified", "value", "for", "the", "given", "column", "and", "related", "pseudo", "columns", "into", "list", "of", "properties", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L209-L218
56,090
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java
EsIndex.putValues
private void putValues(EsRequest doc, EsIndexColumn column, Object[] value) { Object[] columnValue = column.columnValues(value); int[] ln = new int[columnValue.length]; String[] lc = new String[columnValue.length]; String[] uc = new String[columnValue.length]; for (int i = 0; i ...
java
private void putValues(EsRequest doc, EsIndexColumn column, Object[] value) { Object[] columnValue = column.columnValues(value); int[] ln = new int[columnValue.length]; String[] lc = new String[columnValue.length]; String[] uc = new String[columnValue.length]; for (int i = 0; i ...
[ "private", "void", "putValues", "(", "EsRequest", "doc", ",", "EsIndexColumn", "column", ",", "Object", "[", "]", "value", ")", "{", "Object", "[", "]", "columnValue", "=", "column", ".", "columnValues", "(", "value", ")", ";", "int", "[", "]", "ln", "...
Appends specified values for the given column and related pseudo columns into list of properties. @param doc list of properties in json format @param column colum definition @param value column's value.
[ "Appends", "specified", "values", "for", "the", "given", "column", "and", "related", "pseudo", "columns", "into", "list", "of", "properties", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndex.java#L228-L245
56,091
ModeShape/modeshape
checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java
UnusedImports.processIdent
protected void processIdent( DetailAST aAST ) { final int parentType = aAST.getParent().getType(); if (((parentType != TokenTypes.DOT) && (parentType != TokenTypes.METHOD_DEF)) || ((parentType == TokenTypes.DOT) && (aAST.getNextSibling() != null))) { referenced.add(aAST.getText()...
java
protected void processIdent( DetailAST aAST ) { final int parentType = aAST.getParent().getType(); if (((parentType != TokenTypes.DOT) && (parentType != TokenTypes.METHOD_DEF)) || ((parentType == TokenTypes.DOT) && (aAST.getNextSibling() != null))) { referenced.add(aAST.getText()...
[ "protected", "void", "processIdent", "(", "DetailAST", "aAST", ")", "{", "final", "int", "parentType", "=", "aAST", ".", "getParent", "(", ")", ".", "getType", "(", ")", ";", "if", "(", "(", "(", "parentType", "!=", "TokenTypes", ".", "DOT", ")", "&&",...
Collects references made by IDENT. @param aAST the IDENT node to process {@link ArrayList stuff}
[ "Collects", "references", "made", "by", "IDENT", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java#L131-L137
56,092
ModeShape/modeshape
checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java
UnusedImports.processImport
private void processImport( DetailAST aAST ) { final FullIdent name = FullIdent.createFullIdentBelow(aAST); if ((name != null) && !name.getText().endsWith(".*")) { imports.add(name); } }
java
private void processImport( DetailAST aAST ) { final FullIdent name = FullIdent.createFullIdentBelow(aAST); if ((name != null) && !name.getText().endsWith(".*")) { imports.add(name); } }
[ "private", "void", "processImport", "(", "DetailAST", "aAST", ")", "{", "final", "FullIdent", "name", "=", "FullIdent", ".", "createFullIdentBelow", "(", "aAST", ")", ";", "if", "(", "(", "name", "!=", "null", ")", "&&", "!", "name", ".", "getText", "(",...
Collects the details of imports. @param aAST node containing the import details
[ "Collects", "the", "details", "of", "imports", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java#L225-L230
56,093
ModeShape/modeshape
checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java
UnusedImports.processStaticImport
private void processStaticImport( DetailAST aAST ) { final FullIdent name = FullIdent.createFullIdent(aAST.getFirstChild().getNextSibling()); if ((name != null) && !name.getText().endsWith(".*")) { imports.add(name); } }
java
private void processStaticImport( DetailAST aAST ) { final FullIdent name = FullIdent.createFullIdent(aAST.getFirstChild().getNextSibling()); if ((name != null) && !name.getText().endsWith(".*")) { imports.add(name); } }
[ "private", "void", "processStaticImport", "(", "DetailAST", "aAST", ")", "{", "final", "FullIdent", "name", "=", "FullIdent", ".", "createFullIdent", "(", "aAST", ".", "getFirstChild", "(", ")", ".", "getNextSibling", "(", ")", ")", ";", "if", "(", "(", "n...
Collects the details of static imports. @param aAST node containing the static import details
[ "Collects", "the", "details", "of", "static", "imports", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/checkstyle/src/main/java/org/modeshape/checkstyle/UnusedImports.java#L237-L242
56,094
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/Privileges.java
Privileges.forName
public PrivilegeImpl forName(String name) { if (name.contains("}")) { String localName = name.substring(name.indexOf('}') + 1); return privileges.get(localName); } if (name.contains(":")) { String localName = name.substring(name.indexOf(':') + 1); ...
java
public PrivilegeImpl forName(String name) { if (name.contains("}")) { String localName = name.substring(name.indexOf('}') + 1); return privileges.get(localName); } if (name.contains(":")) { String localName = name.substring(name.indexOf(':') + 1); ...
[ "public", "PrivilegeImpl", "forName", "(", "String", "name", ")", "{", "if", "(", "name", ".", "contains", "(", "\"}\"", ")", ")", "{", "String", "localName", "=", "name", ".", "substring", "(", "name", ".", "indexOf", "(", "'", "'", ")", "+", "1", ...
Searches privilege object for the privilege with the given name. @param name the name of privilege to find. @return the privilege object or null if not found.
[ "Searches", "privilege", "object", "for", "the", "privilege", "with", "the", "given", "name", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/Privileges.java#L174-L187
56,095
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/cache/change/RecordingChanges.java
RecordingChanges.setChangedNodes
public void setChangedNodes( Set<NodeKey> keys ) { if (keys != null) { this.nodeKeys = Collections.unmodifiableSet(new HashSet<NodeKey>(keys)); } }
java
public void setChangedNodes( Set<NodeKey> keys ) { if (keys != null) { this.nodeKeys = Collections.unmodifiableSet(new HashSet<NodeKey>(keys)); } }
[ "public", "void", "setChangedNodes", "(", "Set", "<", "NodeKey", ">", "keys", ")", "{", "if", "(", "keys", "!=", "null", ")", "{", "this", ".", "nodeKeys", "=", "Collections", ".", "unmodifiableSet", "(", "new", "HashSet", "<", "NodeKey", ">", "(", "ke...
Sets the list of node keys involved in this change set. @param keys a Set<NodeKey>; may not be null
[ "Sets", "the", "list", "of", "node", "keys", "involved", "in", "this", "change", "set", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/change/RecordingChanges.java#L297-L301
56,096
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java
QueryUtil.hasWildcardCharacters
public static boolean hasWildcardCharacters( String expression ) { Objects.requireNonNull(expression); CharacterIterator iter = new StringCharacterIterator(expression); boolean skipNext = false; for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { if (s...
java
public static boolean hasWildcardCharacters( String expression ) { Objects.requireNonNull(expression); CharacterIterator iter = new StringCharacterIterator(expression); boolean skipNext = false; for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { if (s...
[ "public", "static", "boolean", "hasWildcardCharacters", "(", "String", "expression", ")", "{", "Objects", ".", "requireNonNull", "(", "expression", ")", ";", "CharacterIterator", "iter", "=", "new", "StringCharacterIterator", "(", "expression", ")", ";", "boolean", ...
Checks if the given expression has any wildcard characters @param expression a {@code String} value, never {@code null} @return true if the expression has wildcard characters, false otherwise
[ "Checks", "if", "the", "given", "expression", "has", "any", "wildcard", "characters" ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java#L38-L51
56,097
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java
QueryUtil.toRegularExpression
public static String toRegularExpression( String likeExpression ) { // Replace all '\x' with 'x' ... String result = likeExpression.replaceAll("\\\\(.)", "$1"); // Escape characters used as metacharacters in regular expressions, including // '[', '^', '\', '$', '.', '|', '+', '(', and ')...
java
public static String toRegularExpression( String likeExpression ) { // Replace all '\x' with 'x' ... String result = likeExpression.replaceAll("\\\\(.)", "$1"); // Escape characters used as metacharacters in regular expressions, including // '[', '^', '\', '$', '.', '|', '+', '(', and ')...
[ "public", "static", "String", "toRegularExpression", "(", "String", "likeExpression", ")", "{", "// Replace all '\\x' with 'x' ...", "String", "result", "=", "likeExpression", ".", "replaceAll", "(", "\"\\\\\\\\(.)\"", ",", "\"$1\"", ")", ";", "// Escape characters used a...
Convert the JCR like expression to a regular expression. The JCR like expression uses '%' to match 0 or more characters, '_' to match any single character, '\x' to match the 'x' character, and all other characters to match themselves. Note that if any regex metacharacters appear in the like expression, they will be esc...
[ "Convert", "the", "JCR", "like", "expression", "to", "a", "regular", "expression", ".", "The", "JCR", "like", "expression", "uses", "%", "to", "match", "0", "or", "more", "characters", "_", "to", "match", "any", "single", "character", "\\", "x", "to", "m...
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/QueryUtil.java#L84-L98
56,098
ModeShape/modeshape
modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/AnonymousCredentials.java
AnonymousCredentials.getAttributeNames
public String[] getAttributeNames() { synchronized (attributes) { return attributes.keySet().toArray(new String[attributes.keySet().size()]); } }
java
public String[] getAttributeNames() { synchronized (attributes) { return attributes.keySet().toArray(new String[attributes.keySet().size()]); } }
[ "public", "String", "[", "]", "getAttributeNames", "(", ")", "{", "synchronized", "(", "attributes", ")", "{", "return", "attributes", ".", "keySet", "(", ")", ".", "toArray", "(", "new", "String", "[", "attributes", ".", "keySet", "(", ")", ".", "size",...
Returns the names of the attributes available to this credentials instance. This method returns an empty array if the credentials instance has no attributes available to it. @return a string array containing the names of the stored attributes
[ "Returns", "the", "names", "of", "the", "attributes", "available", "to", "this", "credentials", "instance", ".", "This", "method", "returns", "an", "empty", "array", "if", "the", "credentials", "instance", "has", "no", "attributes", "available", "to", "it", "....
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/AnonymousCredentials.java#L142-L146
56,099
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/xpath/XPathToQueryTranslator.java
XPathToQueryTranslator.appliesToPathConstraint
protected boolean appliesToPathConstraint( List<Component> predicates ) { if (predicates.isEmpty()) return true; if (predicates.size() > 1) return false; assert predicates.size() == 1; Component predicate = predicates.get(0); if (predicate instanceof Literal && ((Literal)predicat...
java
protected boolean appliesToPathConstraint( List<Component> predicates ) { if (predicates.isEmpty()) return true; if (predicates.size() > 1) return false; assert predicates.size() == 1; Component predicate = predicates.get(0); if (predicate instanceof Literal && ((Literal)predicat...
[ "protected", "boolean", "appliesToPathConstraint", "(", "List", "<", "Component", ">", "predicates", ")", "{", "if", "(", "predicates", ".", "isEmpty", "(", ")", ")", "return", "true", ";", "if", "(", "predicates", ".", "size", "(", ")", ">", "1", ")", ...
Determine if the predicates contain any expressions that cannot be put into a LIKE constraint on the path. @param predicates the predicates @return true if the supplied predicates can be handled entirely in the LIKE constraint on the path, or false if they have to be handled as other criteria
[ "Determine", "if", "the", "predicates", "contain", "any", "expressions", "that", "cannot", "be", "put", "into", "a", "LIKE", "constraint", "on", "the", "path", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/xpath/XPathToQueryTranslator.java#L725-L733