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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
48,600 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.printMessage | private void printMessage(final String message, final PrintStream stream, final int priority) {
if (useColor && priority == Project.MSG_ERR) {
stream.print(ANSI_RED);
stream.print(message);
stream.println(ANSI_RESET);
} else {
stream.println(message);
... | java | private void printMessage(final String message, final PrintStream stream, final int priority) {
if (useColor && priority == Project.MSG_ERR) {
stream.print(ANSI_RED);
stream.print(message);
stream.println(ANSI_RESET);
} else {
stream.println(message);
... | [
"private",
"void",
"printMessage",
"(",
"final",
"String",
"message",
",",
"final",
"PrintStream",
"stream",
",",
"final",
"int",
"priority",
")",
"{",
"if",
"(",
"useColor",
"&&",
"priority",
"==",
"Project",
".",
"MSG_ERR",
")",
"{",
"stream",
".",
"prin... | Prints a message to a PrintStream.
@param message The message to print. Should not be <code>null</code>.
@param stream A PrintStream to print the message to. Must not be
<code>null</code>.
@param priority The priority of the message. (Ignored in this
implementation.) | [
"Prints",
"a",
"message",
"to",
"a",
"PrintStream",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L364-L372 |
48,601 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.getTimestamp | protected String getTimestamp() {
final Date date = new Date(System.currentTimeMillis());
final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
return formatter.format(date);
} | java | protected String getTimestamp() {
final Date date = new Date(System.currentTimeMillis());
final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
return formatter.format(date);
} | [
"protected",
"String",
"getTimestamp",
"(",
")",
"{",
"final",
"Date",
"date",
"=",
"new",
"Date",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"final",
"DateFormat",
"formatter",
"=",
"DateFormat",
".",
"getDateTimeInstance",
"(",
"DateFormat"... | Get the current time.
@return the current time as a formatted string.
@since Ant1.7.1 | [
"Get",
"the",
"current",
"time",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L389-L393 |
48,602 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.extractProjectName | protected String extractProjectName(final BuildEvent event) {
final Project project = event.getProject();
return (project != null) ? project.getName() : null;
} | java | protected String extractProjectName(final BuildEvent event) {
final Project project = event.getProject();
return (project != null) ? project.getName() : null;
} | [
"protected",
"String",
"extractProjectName",
"(",
"final",
"BuildEvent",
"event",
")",
"{",
"final",
"Project",
"project",
"=",
"event",
".",
"getProject",
"(",
")",
";",
"return",
"(",
"project",
"!=",
"null",
")",
"?",
"project",
".",
"getName",
"(",
")"... | Get the project name or null
@param event the event
@return the project that raised this event
@since Ant1.7.1 | [
"Get",
"the",
"project",
"name",
"or",
"null"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L402-L405 |
48,603 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/TopicRefWriter.java | TopicRefWriter.setup | public void setup(final Map<URI, URI> conflictTable) {
for (final Map.Entry<URI, URI> e: changeTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
this.conflictTable = conflictTable;
} | java | public void setup(final Map<URI, URI> conflictTable) {
for (final Map.Entry<URI, URI> e: changeTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
this.conflictTable = conflictTable;
} | [
"public",
"void",
"setup",
"(",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"conflictTable",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"URI",
",",
"URI",
">",
"e",
":",
"changeTable",
".",
"entrySet",
"(",
")",
")",
"{",
"assert",
... | Set up class.
@param conflictTable conflictTable | [
"Set",
"up",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/TopicRefWriter.java#L49-L55 |
48,604 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/TopicRefWriter.java | TopicRefWriter.isLocalDita | private boolean isLocalDita(final Attributes atts) {
final String classValue = atts.getValue(ATTRIBUTE_NAME_CLASS);
if (classValue == null
|| (TOPIC_IMAGE.matches(classValue))) {
return false;
}
String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
... | java | private boolean isLocalDita(final Attributes atts) {
final String classValue = atts.getValue(ATTRIBUTE_NAME_CLASS);
if (classValue == null
|| (TOPIC_IMAGE.matches(classValue))) {
return false;
}
String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
... | [
"private",
"boolean",
"isLocalDita",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"String",
"classValue",
"=",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_CLASS",
")",
";",
"if",
"(",
"classValue",
"==",
"null",
"||",
"(",
"TOPIC_IMAGE",
".",
"ma... | Check whether the attributes contains references
@param atts element attributes
@return {@code true} if local DITA reference, otherwise {@code false} | [
"Check",
"whether",
"the",
"attributes",
"contains",
"references"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/TopicRefWriter.java#L117-L135 |
48,605 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/TopicRefWriter.java | TopicRefWriter.getElementID | private String getElementID(final String relativePath) {
final String fragment = getFragment(relativePath);
if (fragment != null) {
if (fragment.lastIndexOf(SLASH) != -1) {
return fragment.substring(fragment.lastIndexOf(SLASH) + 1);
} else {
return... | java | private String getElementID(final String relativePath) {
final String fragment = getFragment(relativePath);
if (fragment != null) {
if (fragment.lastIndexOf(SLASH) != -1) {
return fragment.substring(fragment.lastIndexOf(SLASH) + 1);
} else {
return... | [
"private",
"String",
"getElementID",
"(",
"final",
"String",
"relativePath",
")",
"{",
"final",
"String",
"fragment",
"=",
"getFragment",
"(",
"relativePath",
")",
";",
"if",
"(",
"fragment",
"!=",
"null",
")",
"{",
"if",
"(",
"fragment",
".",
"lastIndexOf",... | Retrieve the element ID from the path. If there is no element ID, return topic ID. | [
"Retrieve",
"the",
"element",
"ID",
"from",
"the",
"path",
".",
"If",
"there",
"is",
"no",
"element",
"ID",
"return",
"topic",
"ID",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/TopicRefWriter.java#L228-L238 |
48,606 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/DITAOTCollator.java | DITAOTCollator.getInstance | public static DITAOTCollator getInstance(final Locale locale) {
if (locale == null) {
throw new NullPointerException("Locale may not be null");
}
DITAOTCollator instance;
instance = cache.computeIfAbsent(locale, DITAOTCollator::new);
return instance;
} | java | public static DITAOTCollator getInstance(final Locale locale) {
if (locale == null) {
throw new NullPointerException("Locale may not be null");
}
DITAOTCollator instance;
instance = cache.computeIfAbsent(locale, DITAOTCollator::new);
return instance;
} | [
"public",
"static",
"DITAOTCollator",
"getInstance",
"(",
"final",
"Locale",
"locale",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Locale may not be null\"",
")",
";",
"}",
"DITAOTCollator",
"instance",
... | Return the DITAOTCollator instance specifying Locale.
@param locale the locale
@return DITAOTCollator | [
"Return",
"the",
"DITAOTCollator",
"instance",
"specifying",
"Locale",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DITAOTCollator.java#L38-L45 |
48,607 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/DITAOTCollator.java | DITAOTCollator.compare | @Override
public int compare(final Object source, final Object target) {
try {
return (Integer) compareMethod.invoke(collatorInstance, source, target);
} catch (final Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | java | @Override
public int compare(final Object source, final Object target) {
try {
return (Integer) compareMethod.invoke(collatorInstance, source, target);
} catch (final Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"final",
"Object",
"source",
",",
"final",
"Object",
"target",
")",
"{",
"try",
"{",
"return",
"(",
"Integer",
")",
"compareMethod",
".",
"invoke",
"(",
"collatorInstance",
",",
"source",
",",
"target",
")"... | Comparing method required to compare.
@see java.util.Comparator#compare(java.lang.Object, java.lang.Object) | [
"Comparing",
"method",
"required",
"to",
"compare",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DITAOTCollator.java#L68-L75 |
48,608 | dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.process | public IndexPreprocessResult process(final Document theInput)
throws ProcessException {
final DocumentBuilder documentBuilder = XMLUtils.getDocumentBuilder();
final Document doc = documentBuilder.newDocument();
final Node rootElement = theInput.getDocumentElement();
final ... | java | public IndexPreprocessResult process(final Document theInput)
throws ProcessException {
final DocumentBuilder documentBuilder = XMLUtils.getDocumentBuilder();
final Document doc = documentBuilder.newDocument();
final Node rootElement = theInput.getDocumentElement();
final ... | [
"public",
"IndexPreprocessResult",
"process",
"(",
"final",
"Document",
"theInput",
")",
"throws",
"ProcessException",
"{",
"final",
"DocumentBuilder",
"documentBuilder",
"=",
"XMLUtils",
".",
"getDocumentBuilder",
"(",
")",
";",
"final",
"Document",
"doc",
"=",
"do... | Process index terms.
@param theInput input document
@return read index terms
@throws ProcessException if processing index terms failed | [
"Process",
"index",
"terms",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L95-L118 |
48,609 | dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.processCurrNode | private Node[] processCurrNode(final Node theNode, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final NodeList childNodes = theNode.getChildNodes();
if (checkElementName(theNode) && !excludedDraftSection.peek()) {
return processIndexNode(theN... | java | private Node[] processCurrNode(final Node theNode, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final NodeList childNodes = theNode.getChildNodes();
if (checkElementName(theNode) && !excludedDraftSection.peek()) {
return processIndexNode(theN... | [
"private",
"Node",
"[",
"]",
"processCurrNode",
"(",
"final",
"Node",
"theNode",
",",
"final",
"Document",
"theTargetDocument",
",",
"final",
"IndexEntryFoundListener",
"theIndexEntryFoundListener",
")",
"{",
"final",
"NodeList",
"childNodes",
"=",
"theNode",
".",
"... | Processes curr node. Copies node to the target document if its is not a text node of index entry element.
Otherwise it process it and creates nodes with "prefix" in given "namespace_url" from the parsed index entry text.
@param theNode node to process
@param theTargetDocument target documen... | [
"Processes",
"curr",
"node",
".",
"Copies",
"node",
"to",
"the",
"target",
"document",
"if",
"its",
"is",
"not",
"a",
"text",
"node",
"of",
"index",
"entry",
"element",
".",
"Otherwise",
"it",
"process",
"it",
"and",
"creates",
"nodes",
"with",
"prefix",
... | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L161-L182 |
48,610 | dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.checkElementName | private boolean checkElementName(final Node node) {
return TOPIC_INDEXTERM.matches(node)
|| INDEXING_D_INDEX_SORT_AS.matches(node)
|| INDEXING_D_INDEX_SEE.matches(node)
|| INDEXING_D_INDEX_SEE_ALSO.matches(node);
} | java | private boolean checkElementName(final Node node) {
return TOPIC_INDEXTERM.matches(node)
|| INDEXING_D_INDEX_SORT_AS.matches(node)
|| INDEXING_D_INDEX_SEE.matches(node)
|| INDEXING_D_INDEX_SEE_ALSO.matches(node);
} | [
"private",
"boolean",
"checkElementName",
"(",
"final",
"Node",
"node",
")",
"{",
"return",
"TOPIC_INDEXTERM",
".",
"matches",
"(",
"node",
")",
"||",
"INDEXING_D_INDEX_SORT_AS",
".",
"matches",
"(",
"node",
")",
"||",
"INDEXING_D_INDEX_SEE",
".",
"matches",
"("... | Check if node is an index term element or specialization of one.
@param node element to test
@return {@code true} if node is an index term element, otherwise {@code false} | [
"Check",
"if",
"node",
"is",
"an",
"index",
"term",
"element",
"or",
"specialization",
"of",
"one",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L248-L253 |
48,611 | dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.processIndexString | private Node[] processIndexString(final String theIndexString, final List<Node> contents, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final IndexEntry[] indexEntries = IndexStringProcessor.processIndexString(theIndexString, contents);
for (final IndexE... | java | private Node[] processIndexString(final String theIndexString, final List<Node> contents, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final IndexEntry[] indexEntries = IndexStringProcessor.processIndexString(theIndexString, contents);
for (final IndexE... | [
"private",
"Node",
"[",
"]",
"processIndexString",
"(",
"final",
"String",
"theIndexString",
",",
"final",
"List",
"<",
"Node",
">",
"contents",
",",
"final",
"Document",
"theTargetDocument",
",",
"final",
"IndexEntryFoundListener",
"theIndexEntryFoundListener",
")",
... | Processes index string and creates nodes with "prefix" in given "namespace_url" from the parsed index entry text.
@param theIndexString index string
param contents index contents
@param theTargetDocument target document to create new nodes
@param theIndexEntryFoundListener listener to notify that ... | [
"Processes",
"index",
"string",
"and",
"creates",
"nodes",
"with",
"prefix",
"in",
"given",
"namespace_url",
"from",
"the",
"parsed",
"index",
"entry",
"text",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L269-L278 |
48,612 | dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.createElement | private Element createElement(final Document theTargetDocument, final String theName) {
final Element indexEntryNode = theTargetDocument.createElementNS(this.namespace_url, theName);
indexEntryNode.setPrefix(this.prefix);
return indexEntryNode;
} | java | private Element createElement(final Document theTargetDocument, final String theName) {
final Element indexEntryNode = theTargetDocument.createElementNS(this.namespace_url, theName);
indexEntryNode.setPrefix(this.prefix);
return indexEntryNode;
} | [
"private",
"Element",
"createElement",
"(",
"final",
"Document",
"theTargetDocument",
",",
"final",
"String",
"theName",
")",
"{",
"final",
"Element",
"indexEntryNode",
"=",
"theTargetDocument",
".",
"createElementNS",
"(",
"this",
".",
"namespace_url",
",",
"theNam... | Creates element with "prefix" in "namespace_url" with given name for the target document
@param theTargetDocument target document
@param theName name
@return new element | [
"Creates",
"element",
"with",
"prefix",
"in",
"namespace_url",
"with",
"given",
"name",
"for",
"the",
"target",
"document"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L388-L392 |
48,613 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.getNonTopicrefReferenceSet | public Set<URI> getNonTopicrefReferenceSet() {
final Set<URI> res = new HashSet<>(nonTopicrefReferenceSet);
res.removeAll(normalProcessingRoleSet);
res.removeAll(resourceOnlySet);
return res;
} | java | public Set<URI> getNonTopicrefReferenceSet() {
final Set<URI> res = new HashSet<>(nonTopicrefReferenceSet);
res.removeAll(normalProcessingRoleSet);
res.removeAll(resourceOnlySet);
return res;
} | [
"public",
"Set",
"<",
"URI",
">",
"getNonTopicrefReferenceSet",
"(",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"res",
"=",
"new",
"HashSet",
"<>",
"(",
"nonTopicrefReferenceSet",
")",
";",
"res",
".",
"removeAll",
"(",
"normalProcessingRoleSet",
")",
";",
... | List of files referenced by something other than topicref
@return the resource-only set | [
"List",
"of",
"files",
"referenced",
"by",
"something",
"other",
"than",
"topicref"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L147-L152 |
48,614 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.getNonCopytoResult | public Set<Reference> getNonCopytoResult() {
final Set<Reference> nonCopytoSet = new LinkedHashSet<>(128);
nonCopytoSet.addAll(nonConrefCopytoTargets);
for (final URI f : conrefTargets) {
nonCopytoSet.add(new Reference(stripFragment(f), currentFileFormat()));
}
for (... | java | public Set<Reference> getNonCopytoResult() {
final Set<Reference> nonCopytoSet = new LinkedHashSet<>(128);
nonCopytoSet.addAll(nonConrefCopytoTargets);
for (final URI f : conrefTargets) {
nonCopytoSet.add(new Reference(stripFragment(f), currentFileFormat()));
}
for (... | [
"public",
"Set",
"<",
"Reference",
">",
"getNonCopytoResult",
"(",
")",
"{",
"final",
"Set",
"<",
"Reference",
">",
"nonCopytoSet",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
"128",
")",
";",
"nonCopytoSet",
".",
"addAll",
"(",
"nonConrefCopytoTargets",
")",
";... | Get all targets except copy-to.
@return set of target file path with option format after
{@link org.dita.dost.util.Constants#STICK STICK} | [
"Get",
"all",
"targets",
"except",
"copy",
"-",
"to",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L245-L262 |
48,615 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.getNonConrefCopytoTargets | public Set<URI> getNonConrefCopytoTargets() {
final Set<URI> res = new HashSet<>(nonConrefCopytoTargets.size());
for (final Reference r : nonConrefCopytoTargets) {
res.add(r.filename);
}
return res;
} | java | public Set<URI> getNonConrefCopytoTargets() {
final Set<URI> res = new HashSet<>(nonConrefCopytoTargets.size());
for (final Reference r : nonConrefCopytoTargets) {
res.add(r.filename);
}
return res;
} | [
"public",
"Set",
"<",
"URI",
">",
"getNonConrefCopytoTargets",
"(",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"res",
"=",
"new",
"HashSet",
"<>",
"(",
"nonConrefCopytoTargets",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"final",
"Reference",
"r",
":... | Get non-conref and non-copyto targets.
@return Returns the nonConrefCopytoTargets. | [
"Get",
"non",
"-",
"conref",
"and",
"non",
"-",
"copyto",
"targets",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L314-L320 |
48,616 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.canFollow | public static boolean canFollow(URI href) {
if (href != null && href.getScheme() != null && href.getScheme().equals("mailto")) {
return false;
}
return true;
} | java | public static boolean canFollow(URI href) {
if (href != null && href.getScheme() != null && href.getScheme().equals("mailto")) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"canFollow",
"(",
"URI",
"href",
")",
"{",
"if",
"(",
"href",
"!=",
"null",
"&&",
"href",
".",
"getScheme",
"(",
")",
"!=",
"null",
"&&",
"href",
".",
"getScheme",
"(",
")",
".",
"equals",
"(",
"\"mailto\"",
")",
")",
... | Make educated guess in advance whether URI can be resolved to a file. | [
"Make",
"educated",
"guess",
"in",
"advance",
"whether",
"URI",
"can",
"be",
"resolved",
"to",
"a",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L639-L644 |
48,617 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.isOutFile | private boolean isOutFile(final URI toCheckPath) {
final String path = toCheckPath.getPath();
return !(path != null && path.startsWith(rootDir.getPath()));
} | java | private boolean isOutFile(final URI toCheckPath) {
final String path = toCheckPath.getPath();
return !(path != null && path.startsWith(rootDir.getPath()));
} | [
"private",
"boolean",
"isOutFile",
"(",
"final",
"URI",
"toCheckPath",
")",
"{",
"final",
"String",
"path",
"=",
"toCheckPath",
".",
"getPath",
"(",
")",
";",
"return",
"!",
"(",
"path",
"!=",
"null",
"&&",
"path",
".",
"startsWith",
"(",
"rootDir",
".",... | Check if path walks up in parent directories
@param toCheckPath path to check
@return {@code true} if path walks up, otherwise {@code false} | [
"Check",
"if",
"path",
"walks",
"up",
"in",
"parent",
"directories"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L742-L745 |
48,618 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/FileGenerator.java | FileGenerator.generate | public void generate(final File fileName) {
final File outputFile = removeTemplatePrefix(fileName);
templateFile = fileName;
try (final InputStream in = new BufferedInputStream(new FileInputStream(fileName));
final OutputStream out = new BufferedOutputStream(new FileOutputStream(ou... | java | public void generate(final File fileName) {
final File outputFile = removeTemplatePrefix(fileName);
templateFile = fileName;
try (final InputStream in = new BufferedInputStream(new FileInputStream(fileName));
final OutputStream out = new BufferedOutputStream(new FileOutputStream(ou... | [
"public",
"void",
"generate",
"(",
"final",
"File",
"fileName",
")",
"{",
"final",
"File",
"outputFile",
"=",
"removeTemplatePrefix",
"(",
"fileName",
")",
";",
"templateFile",
"=",
"fileName",
";",
"try",
"(",
"final",
"InputStream",
"in",
"=",
"new",
"Buff... | Generator the output file.
@param fileName filename | [
"Generator",
"the",
"output",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/FileGenerator.java#L82-L104 |
48,619 | dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java | RelaxNGDefaultValues.update | public void update(InputSource in) throws SAXException {
defaultValuesCollector = null;
PropertyMapBuilder builder = new PropertyMapBuilder();
//Set the resolver
builder.put(ValidateProperty.RESOLVER, resolver);
builder.put(ValidateProperty.ERROR_HANDLER, eh);
PropertyMap properties = builder.... | java | public void update(InputSource in) throws SAXException {
defaultValuesCollector = null;
PropertyMapBuilder builder = new PropertyMapBuilder();
//Set the resolver
builder.put(ValidateProperty.RESOLVER, resolver);
builder.put(ValidateProperty.ERROR_HANDLER, eh);
PropertyMap properties = builder.... | [
"public",
"void",
"update",
"(",
"InputSource",
"in",
")",
"throws",
"SAXException",
"{",
"defaultValuesCollector",
"=",
"null",
";",
"PropertyMapBuilder",
"builder",
"=",
"new",
"PropertyMapBuilder",
"(",
")",
";",
"//Set the resolver",
"builder",
".",
"put",
"("... | Updates the annotation model.
@param in The schema input source. | [
"Updates",
"the",
"annotation",
"model",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java#L147-L165 |
48,620 | dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java | RelaxNGDefaultValues.getDefaultAttributes | public List<Attribute> getDefaultAttributes(String localName, String namespace) {
if (defaultValuesCollector != null) {
return defaultValuesCollector.getDefaultAttributes(localName, namespace);
}
return null;
} | java | public List<Attribute> getDefaultAttributes(String localName, String namespace) {
if (defaultValuesCollector != null) {
return defaultValuesCollector.getDefaultAttributes(localName, namespace);
}
return null;
} | [
"public",
"List",
"<",
"Attribute",
">",
"getDefaultAttributes",
"(",
"String",
"localName",
",",
"String",
"namespace",
")",
"{",
"if",
"(",
"defaultValuesCollector",
"!=",
"null",
")",
"{",
"return",
"defaultValuesCollector",
".",
"getDefaultAttributes",
"(",
"l... | Get the default attributes for an element.
@param localName
The element local name.
@param namespace
The element namespace. Use null or empty for no namespace.
@return A list of Attribute objects or null if no defaults. | [
"Get",
"the",
"default",
"attributes",
"for",
"an",
"element",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java#L176-L181 |
48,621 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleID | private void handleID(final AttributesImpl atts) {
String idValue = atts.getValue(ATTRIBUTE_NAME_ID);
if (idValue != null) {
XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_OID, idValue);
final URI value = setFragment(dirPath.toURI().resolve(toURI(filePath)), idValue);
... | java | private void handleID(final AttributesImpl atts) {
String idValue = atts.getValue(ATTRIBUTE_NAME_ID);
if (idValue != null) {
XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_OID, idValue);
final URI value = setFragment(dirPath.toURI().resolve(toURI(filePath)), idValue);
... | [
"private",
"void",
"handleID",
"(",
"final",
"AttributesImpl",
"atts",
")",
"{",
"String",
"idValue",
"=",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_ID",
")",
";",
"if",
"(",
"idValue",
"!=",
"null",
")",
"{",
"XMLUtils",
".",
"addOrSetAttribute",
"(",
... | Get new value for topic id attribute. | [
"Get",
"new",
"value",
"for",
"topic",
"id",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L104-L116 |
48,622 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleLocalDita | private URI handleLocalDita(final URI href, final AttributesImpl atts) {
final URI attValue = href;
final int sharpIndex = attValue.toString().indexOf(SHARP);
URI pathFromMap;
URI retAttValue;
if (sharpIndex != -1) { // href value refer to an id in a topic
if (sharpIn... | java | private URI handleLocalDita(final URI href, final AttributesImpl atts) {
final URI attValue = href;
final int sharpIndex = attValue.toString().indexOf(SHARP);
URI pathFromMap;
URI retAttValue;
if (sharpIndex != -1) { // href value refer to an id in a topic
if (sharpIn... | [
"private",
"URI",
"handleLocalDita",
"(",
"final",
"URI",
"href",
",",
"final",
"AttributesImpl",
"atts",
")",
"{",
"final",
"URI",
"attValue",
"=",
"href",
";",
"final",
"int",
"sharpIndex",
"=",
"attValue",
".",
"toString",
"(",
")",
".",
"indexOf",
"(",... | Rewrite local DITA href value.
@param href href attribute value
@return rewritten href value | [
"Rewrite",
"local",
"DITA",
"href",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L124-L165 |
48,623 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.parse | public void parse(final String filename, final File dir) {
filePath = stripFragment(filename);
dirPath = dir;
try {
final File f = new File(dir, filePath);
reader.setErrorHandler(new DITAOTXMLErrorHandler(f.getAbsolutePath(), logger));
logger.info("Processing ... | java | public void parse(final String filename, final File dir) {
filePath = stripFragment(filename);
dirPath = dir;
try {
final File f = new File(dir, filePath);
reader.setErrorHandler(new DITAOTXMLErrorHandler(f.getAbsolutePath(), logger));
logger.info("Processing ... | [
"public",
"void",
"parse",
"(",
"final",
"String",
"filename",
",",
"final",
"File",
"dir",
")",
"{",
"filePath",
"=",
"stripFragment",
"(",
"filename",
")",
";",
"dirPath",
"=",
"dir",
";",
"try",
"{",
"final",
"File",
"f",
"=",
"new",
"File",
"(",
... | Parse the file to update id.
@param filename relative topic system path, may contain a fragment part
@param dir topic directory system path | [
"Parse",
"the",
"file",
"to",
"update",
"id",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L178-L191 |
48,624 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleHref | private void handleHref(final String classValue, final AttributesImpl atts) {
final URI attValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
if (attValue != null) {
final String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
if ((scopeValue == null || ATTR_SCOPE_VALUE_LOCAL.e... | java | private void handleHref(final String classValue, final AttributesImpl atts) {
final URI attValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
if (attValue != null) {
final String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
if ((scopeValue == null || ATTR_SCOPE_VALUE_LOCAL.e... | [
"private",
"void",
"handleHref",
"(",
"final",
"String",
"classValue",
",",
"final",
"AttributesImpl",
"atts",
")",
"{",
"final",
"URI",
"attValue",
"=",
"toURI",
"(",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_HREF",
")",
")",
";",
"if",
"(",
"attValue",... | Rewrite href attribute.
@param classValue element class value
@param atts attributes | [
"Rewrite",
"href",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L228-L251 |
48,625 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleLocalHref | private URI handleLocalHref(final URI attValue) {
final URI current = new File(dirPath, filePath).toURI().normalize();
final URI reference = current.resolve(attValue);
final URI merge = output.toURI();
return getRelativePath(merge, reference);
} | java | private URI handleLocalHref(final URI attValue) {
final URI current = new File(dirPath, filePath).toURI().normalize();
final URI reference = current.resolve(attValue);
final URI merge = output.toURI();
return getRelativePath(merge, reference);
} | [
"private",
"URI",
"handleLocalHref",
"(",
"final",
"URI",
"attValue",
")",
"{",
"final",
"URI",
"current",
"=",
"new",
"File",
"(",
"dirPath",
",",
"filePath",
")",
".",
"toURI",
"(",
")",
".",
"normalize",
"(",
")",
";",
"final",
"URI",
"reference",
"... | Rewrite local non-DITA href value.
@param attValue href attribute value
@return rewritten href value | [
"Rewrite",
"local",
"non",
"-",
"DITA",
"href",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L259-L264 |
48,626 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.start | public static void start(final String[] args, final Properties additionalUserProperties,
final ClassLoader coreLoader) {
final Main m = new Main();
m.startAnt(args, additionalUserProperties, coreLoader);
} | java | public static void start(final String[] args, final Properties additionalUserProperties,
final ClassLoader coreLoader) {
final Main m = new Main();
m.startAnt(args, additionalUserProperties, coreLoader);
} | [
"public",
"static",
"void",
"start",
"(",
"final",
"String",
"[",
"]",
"args",
",",
"final",
"Properties",
"additionalUserProperties",
",",
"final",
"ClassLoader",
"coreLoader",
")",
"{",
"final",
"Main",
"m",
"=",
"new",
"Main",
"(",
")",
";",
"m",
".",
... | Creates a new instance of this class using the arguments specified, gives
it any extra user properties which have been specified, and then runs the
build using the classloader provided.
@param args Command line arguments. Must not be <code>null</code>.
@param additionalUserProperties Any extra prop... | [
"Creates",
"a",
"new",
"instance",
"of",
"this",
"class",
"using",
"the",
"arguments",
"specified",
"gives",
"it",
"any",
"extra",
"user",
"properties",
"which",
"have",
"been",
"specified",
"and",
"then",
"runs",
"the",
"build",
"using",
"the",
"classloader",... | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L140-L144 |
48,627 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.handleLogfile | private void handleLogfile() {
if (args.logFile != null) {
FileUtils.close(out);
FileUtils.close(err);
}
} | java | private void handleLogfile() {
if (args.logFile != null) {
FileUtils.close(out);
FileUtils.close(err);
}
} | [
"private",
"void",
"handleLogfile",
"(",
")",
"{",
"if",
"(",
"args",
".",
"logFile",
"!=",
"null",
")",
"{",
"FileUtils",
".",
"close",
"(",
"out",
")",
";",
"FileUtils",
".",
"close",
"(",
"err",
")",
";",
"}",
"}"
] | Close logfiles, if we have been writing to them.
@since Ant 1.6 | [
"Close",
"logfiles",
"if",
"we",
"have",
"been",
"writing",
"to",
"them",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L233-L238 |
48,628 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.addBuildListeners | @Override
protected void addBuildListeners(final Project project) {
// Add the default listener
project.addBuildListener(createLogger());
final int count = args.listeners.size();
for (int i = 0; i < count; i++) {
final String className = args.listeners.elementAt(i);
... | java | @Override
protected void addBuildListeners(final Project project) {
// Add the default listener
project.addBuildListener(createLogger());
final int count = args.listeners.size();
for (int i = 0; i < count; i++) {
final String className = args.listeners.elementAt(i);
... | [
"@",
"Override",
"protected",
"void",
"addBuildListeners",
"(",
"final",
"Project",
"project",
")",
"{",
"// Add the default listener",
"project",
".",
"addBuildListener",
"(",
"createLogger",
"(",
")",
")",
";",
"final",
"int",
"count",
"=",
"args",
".",
"liste... | Adds the listeners specified in the command line arguments, along with
the default listener, to the specified project.
@param project The project to add listeners to. Must not be
<code>null</code>. | [
"Adds",
"the",
"listeners",
"specified",
"in",
"the",
"command",
"line",
"arguments",
"along",
"with",
"the",
"default",
"listener",
"to",
"the",
"specified",
"project",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L666-L680 |
48,629 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.addInputHandler | private void addInputHandler(final Project project) throws BuildException {
final InputHandler handler;
if (args.inputHandlerClassname == null) {
handler = new DefaultInputHandler();
} else {
handler = ClasspathUtils.newInstance(args.inputHandlerClassname, Main.class.getC... | java | private void addInputHandler(final Project project) throws BuildException {
final InputHandler handler;
if (args.inputHandlerClassname == null) {
handler = new DefaultInputHandler();
} else {
handler = ClasspathUtils.newInstance(args.inputHandlerClassname, Main.class.getC... | [
"private",
"void",
"addInputHandler",
"(",
"final",
"Project",
"project",
")",
"throws",
"BuildException",
"{",
"final",
"InputHandler",
"handler",
";",
"if",
"(",
"args",
".",
"inputHandlerClassname",
"==",
"null",
")",
"{",
"handler",
"=",
"new",
"DefaultInput... | Creates the InputHandler and adds it to the project.
@param project the project instance.
@throws BuildException if a specified InputHandler implementation
could not be loaded. | [
"Creates",
"the",
"InputHandler",
"and",
"adds",
"it",
"to",
"the",
"project",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L689-L699 |
48,630 | dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.createLogger | private BuildLogger createLogger() {
BuildLogger logger;
if (args.loggerClassname != null) {
try {
logger = ClasspathUtils.newInstance(args.loggerClassname, Main.class.getClassLoader(),
BuildLogger.class);
} catch (final BuildException e) {... | java | private BuildLogger createLogger() {
BuildLogger logger;
if (args.loggerClassname != null) {
try {
logger = ClasspathUtils.newInstance(args.loggerClassname, Main.class.getClassLoader(),
BuildLogger.class);
} catch (final BuildException e) {... | [
"private",
"BuildLogger",
"createLogger",
"(",
")",
"{",
"BuildLogger",
"logger",
";",
"if",
"(",
"args",
".",
"loggerClassname",
"!=",
"null",
")",
"{",
"try",
"{",
"logger",
"=",
"ClasspathUtils",
".",
"newInstance",
"(",
"args",
".",
"loggerClassname",
",... | Creates the default build logger for sending build events to the ant log.
@return the logger instance for this build. | [
"Creates",
"the",
"default",
"build",
"logger",
"for",
"sending",
"build",
"events",
"to",
"the",
"ant",
"log",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L711-L733 |
48,631 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/XsltModule.java | XsltModule.configureSaxonExtensions | private void configureSaxonExtensions(SaxonTransformerFactory tfi) {
final net.sf.saxon.Configuration conf = tfi.getConfiguration();
for (ExtensionFunctionDefinition def : ServiceLoader.load(ExtensionFunctionDefinition.class)) {
try {
conf.registerExtensionFunction(def.getCla... | java | private void configureSaxonExtensions(SaxonTransformerFactory tfi) {
final net.sf.saxon.Configuration conf = tfi.getConfiguration();
for (ExtensionFunctionDefinition def : ServiceLoader.load(ExtensionFunctionDefinition.class)) {
try {
conf.registerExtensionFunction(def.getCla... | [
"private",
"void",
"configureSaxonExtensions",
"(",
"SaxonTransformerFactory",
"tfi",
")",
"{",
"final",
"net",
".",
"sf",
".",
"saxon",
".",
"Configuration",
"conf",
"=",
"tfi",
".",
"getConfiguration",
"(",
")",
";",
"for",
"(",
"ExtensionFunctionDefinition",
... | Registers Saxon full integrated function definitions.
The intgrated function should be an instance of net.sf.saxon.lib.ExtensionFunctionDefinition abstract class.
@see <a href="https://www.saxonica.com/html/documentation/extensibility/integratedfunctions/ext-full-J.html">Saxon
Java extension functions: full interface</... | [
"Registers",
"Saxon",
"full",
"integrated",
"function",
"definitions",
".",
"The",
"intgrated",
"function",
"should",
"be",
"an",
"instance",
"of",
"net",
".",
"sf",
".",
"saxon",
".",
"lib",
".",
"ExtensionFunctionDefinition",
"abstract",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/XsltModule.java#L272-L284 |
48,632 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/KeyDef.java | KeyDef.writeKeydef | public static void writeKeydef(final File keydefFile, final Collection<KeyDef> keydefs) throws DITAOTException {
XMLStreamWriter keydef = null;
try (OutputStream out = new FileOutputStream(keydefFile)) {
keydef = XMLOutputFactory.newInstance().createXMLStreamWriter(out, "UTF-8");
... | java | public static void writeKeydef(final File keydefFile, final Collection<KeyDef> keydefs) throws DITAOTException {
XMLStreamWriter keydef = null;
try (OutputStream out = new FileOutputStream(keydefFile)) {
keydef = XMLOutputFactory.newInstance().createXMLStreamWriter(out, "UTF-8");
... | [
"public",
"static",
"void",
"writeKeydef",
"(",
"final",
"File",
"keydefFile",
",",
"final",
"Collection",
"<",
"KeyDef",
">",
"keydefs",
")",
"throws",
"DITAOTException",
"{",
"XMLStreamWriter",
"keydef",
"=",
"null",
";",
"try",
"(",
"OutputStream",
"out",
"... | Write key definition XML configuration file
@param keydefFile key definition file
@param keydefs list of key definitions
@throws DITAOTException if writing configuration file failed | [
"Write",
"key",
"definition",
"XML",
"configuration",
"file"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/KeyDef.java#L87-L121 |
48,633 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.getTopicrefs | private List<Element> getTopicrefs(final Element root) {
final List<Element> res = new ArrayList<>();
final NodeList all = root.getElementsByTagName("*");
for (int i = 0; i < all.getLength(); i++) {
final Element elem = (Element) all.item(i);
if (MAP_TOPICREF.matches(elem... | java | private List<Element> getTopicrefs(final Element root) {
final List<Element> res = new ArrayList<>();
final NodeList all = root.getElementsByTagName("*");
for (int i = 0; i < all.getLength(); i++) {
final Element elem = (Element) all.item(i);
if (MAP_TOPICREF.matches(elem... | [
"private",
"List",
"<",
"Element",
">",
"getTopicrefs",
"(",
"final",
"Element",
"root",
")",
"{",
"final",
"List",
"<",
"Element",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"NodeList",
"all",
"=",
"root",
".",
"getElementsByTagN... | Get all topicrefs | [
"Get",
"all",
"topicrefs"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L263-L275 |
48,634 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.generateCopies | private void generateCopies(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String copyTo = topicref.getAttribute(BRANCH_COPY_TO);
if (!copyTo.isEmpty()) {
final URI dstUri = map.resolve(copyTo);
... | java | private void generateCopies(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String copyTo = topicref.getAttribute(BRANCH_COPY_TO);
if (!copyTo.isEmpty()) {
final URI dstUri = map.resolve(copyTo);
... | [
"private",
"void",
"generateCopies",
"(",
"final",
"Element",
"topicref",
",",
"final",
"List",
"<",
"FilterUtils",
">",
"filters",
")",
"{",
"final",
"List",
"<",
"FilterUtils",
">",
"fs",
"=",
"combineFilterUtils",
"(",
"topicref",
",",
"filters",
")",
";"... | Copy and filter topics for branches. These topics have a new name and will be added to job configuration. | [
"Copy",
"and",
"filter",
"topics",
"for",
"branches",
".",
"These",
"topics",
"have",
"a",
"new",
"name",
"and",
"will",
"be",
"added",
"to",
"job",
"configuration",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L342-L388 |
48,635 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.filterTopics | private void filterTopics(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String href = topicref.getAttribute(ATTRIBUTE_NAME_HREF);
final Attr skipFilter = topicref.getAttributeNode(SKIP_FILTER);
final ... | java | private void filterTopics(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String href = topicref.getAttribute(ATTRIBUTE_NAME_HREF);
final Attr skipFilter = topicref.getAttributeNode(SKIP_FILTER);
final ... | [
"private",
"void",
"filterTopics",
"(",
"final",
"Element",
"topicref",
",",
"final",
"List",
"<",
"FilterUtils",
">",
"filters",
")",
"{",
"final",
"List",
"<",
"FilterUtils",
">",
"fs",
"=",
"combineFilterUtils",
"(",
"topicref",
",",
"filters",
")",
";",
... | Modify and filter topics for branches. These files use an existing file name. | [
"Modify",
"and",
"filter",
"topics",
"for",
"branches",
".",
"These",
"files",
"use",
"an",
"existing",
"file",
"name",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L391-L428 |
48,636 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.getFilterUtils | private FilterUtils getFilterUtils(final Element ditavalRef) {
if (ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF).isEmpty()) {
return null;
}
final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
final URI tmp = currentFile.resolve(href);
final FileInfo ... | java | private FilterUtils getFilterUtils(final Element ditavalRef) {
if (ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF).isEmpty()) {
return null;
}
final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
final URI tmp = currentFile.resolve(href);
final FileInfo ... | [
"private",
"FilterUtils",
"getFilterUtils",
"(",
"final",
"Element",
"ditavalRef",
")",
"{",
"if",
"(",
"ditavalRef",
".",
"getAttribute",
"(",
"ATTRIBUTE_NAME_HREF",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URI",
"href"... | Read and cache filter. | [
"Read",
"and",
"cache",
"filter",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L433-L452 |
48,637 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/KeydefFilter.java | KeydefFilter.handleKeysAttr | private void handleKeysAttr(final Attributes atts) {
final String attrValue = atts.getValue(ATTRIBUTE_NAME_KEYS);
if (attrValue != null) {
URI target = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
final URI copyTo = toURI(atts.getValue(ATTRIBUTE_NAME_COPY_TO));
if (copy... | java | private void handleKeysAttr(final Attributes atts) {
final String attrValue = atts.getValue(ATTRIBUTE_NAME_KEYS);
if (attrValue != null) {
URI target = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
final URI copyTo = toURI(atts.getValue(ATTRIBUTE_NAME_COPY_TO));
if (copy... | [
"private",
"void",
"handleKeysAttr",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"String",
"attrValue",
"=",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_KEYS",
")",
";",
"if",
"(",
"attrValue",
"!=",
"null",
")",
"{",
"URI",
"target",
"=",
"to... | Parse the keys attributes.
@param atts all attributes | [
"Parse",
"the",
"keys",
"attributes",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/KeydefFilter.java#L107-L151 |
48,638 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/KeydefFilter.java | KeydefFilter.getKeysList | private List<String> getKeysList(final String key, final Map<String, String> keysRefMap) {
final List<String> list = new ArrayList<>();
// Iterate the map to look for multi-level keys
for (Entry<String, String> entry : keysRefMap.entrySet()) {
// Multi-level key found
if ... | java | private List<String> getKeysList(final String key, final Map<String, String> keysRefMap) {
final List<String> list = new ArrayList<>();
// Iterate the map to look for multi-level keys
for (Entry<String, String> entry : keysRefMap.entrySet()) {
// Multi-level key found
if ... | [
"private",
"List",
"<",
"String",
">",
"getKeysList",
"(",
"final",
"String",
"key",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"keysRefMap",
")",
"{",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Get multi-level keys list | [
"Get",
"multi",
"-",
"level",
"keys",
"list"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/KeydefFilter.java#L156-L174 |
48,639 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/KeydefFilter.java | KeydefFilter.checkMultiLevelKeys | private void checkMultiLevelKeys(final Map<String, KeyDef> keysDefMap, final Map<String, String> keysRefMap) {
String key;
KeyDef value;
// tempMap storing values to avoid ConcurrentModificationException
final Map<String, KeyDef> tempMap = new HashMap<>();
for (Entry<String, KeyD... | java | private void checkMultiLevelKeys(final Map<String, KeyDef> keysDefMap, final Map<String, String> keysRefMap) {
String key;
KeyDef value;
// tempMap storing values to avoid ConcurrentModificationException
final Map<String, KeyDef> tempMap = new HashMap<>();
for (Entry<String, KeyD... | [
"private",
"void",
"checkMultiLevelKeys",
"(",
"final",
"Map",
"<",
"String",
",",
"KeyDef",
">",
"keysDefMap",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"keysRefMap",
")",
"{",
"String",
"key",
";",
"KeyDef",
"value",
";",
"// tempMap storing ... | Update keysDefMap for multi-level keys | [
"Update",
"keysDefMap",
"for",
"multi",
"-",
"level",
"keys"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/KeydefFilter.java#L179-L199 |
48,640 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.setValidateMap | public void setValidateMap(final Map<QName, Map<String, Set<String>>> validateMap) {
this.validateMap = validateMap;
} | java | public void setValidateMap(final Map<QName, Map<String, Set<String>>> validateMap) {
this.validateMap = validateMap;
} | [
"public",
"void",
"setValidateMap",
"(",
"final",
"Map",
"<",
"QName",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
">",
"validateMap",
")",
"{",
"this",
".",
"validateMap",
"=",
"validateMap",
";",
"}"
] | Set valid attribute values.
<p>The contents of the map is in pseudo-code
{@code Map<AttName, Map<ElemName, <Set<Value>>>}.
For default element mapping, the value is {@code *}. | [
"Set",
"valid",
"attribute",
"values",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L56-L58 |
48,641 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateAttributeValues | private void validateAttributeValues(final String qName, final Attributes atts) {
if (validateMap.isEmpty()) {
return;
}
for (int i = 0; i < atts.getLength(); i++) {
final QName attrName = new QName(atts.getURI(i), atts.getLocalName(i));
final Map<String, Set<... | java | private void validateAttributeValues(final String qName, final Attributes atts) {
if (validateMap.isEmpty()) {
return;
}
for (int i = 0; i < atts.getLength(); i++) {
final QName attrName = new QName(atts.getURI(i), atts.getLocalName(i));
final Map<String, Set<... | [
"private",
"void",
"validateAttributeValues",
"(",
"final",
"String",
"qName",
",",
"final",
"Attributes",
"atts",
")",
"{",
"if",
"(",
"validateMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Validate attribute values
@param qName element name
@param atts attributes | [
"Validate",
"attribute",
"values"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L250-L274 |
48,642 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateAttributeGeneralization | private void validateAttributeGeneralization(final Attributes atts) {
final QName[][] d = domains.peekFirst();
if (d != null) {
for (final QName[] spec: d) {
for (int i = spec.length - 1; i > -1; i--) {
if (atts.getValue(spec[i].getNamespaceURI(), spec[i].... | java | private void validateAttributeGeneralization(final Attributes atts) {
final QName[][] d = domains.peekFirst();
if (d != null) {
for (final QName[] spec: d) {
for (int i = spec.length - 1; i > -1; i--) {
if (atts.getValue(spec[i].getNamespaceURI(), spec[i].... | [
"private",
"void",
"validateAttributeGeneralization",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"QName",
"[",
"]",
"[",
"]",
"d",
"=",
"domains",
".",
"peekFirst",
"(",
")",
";",
"if",
"(",
"d",
"!=",
"null",
")",
"{",
"for",
"(",
"final",... | Validate attribute generalization. A single element may not contain both generalized and specialized values for the same attribute.
@param atts attributes
@see <a href="http://docs.oasis-open.org/dita/v1.2/os/spec/archSpec/attributegeneralize.html">DITA 1.2 specification</a> | [
"Validate",
"attribute",
"generalization",
".",
"A",
"single",
"element",
"may",
"not",
"contain",
"both",
"generalized",
"and",
"specialized",
"values",
"for",
"the",
"same",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L351-L367 |
48,643 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.addId | public String addId(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
index ++;
final String newId = PREFIX + Integer.toString(index);
idMap.put(localId, newId);
return newId;
} | java | public String addId(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
index ++;
final String newId = PREFIX + Integer.toString(index);
idMap.put(localId, newId);
return newId;
} | [
"public",
"String",
"addId",
"(",
"final",
"URI",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URI",
"localId",
"=",
"id",
".",
"normalize",
"(",
")",
";",
"index",
"++",
";",
"final",
"String",
"... | Add topic id to the idMap.
@param id topic id
@return updated topic id | [
"Add",
"topic",
"id",
"to",
"the",
"idMap",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L72-L81 |
48,644 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.addId | public void addId(final URI id, final String value) {
if (id != null && value != null) {
final URI localId = id.normalize();
final String localValue = value.trim();
idMap.put(localId, localValue);
}
} | java | public void addId(final URI id, final String value) {
if (id != null && value != null) {
final URI localId = id.normalize();
final String localValue = value.trim();
idMap.put(localId, localValue);
}
} | [
"public",
"void",
"addId",
"(",
"final",
"URI",
"id",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
"&&",
"value",
"!=",
"null",
")",
"{",
"final",
"URI",
"localId",
"=",
"id",
".",
"normalize",
"(",
")",
";",
"final",
... | Add topic id-value pairs to idMap.
@param id id
@param value value | [
"Add",
"topic",
"id",
"-",
"value",
"pairs",
"to",
"idMap",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L88-L94 |
48,645 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.getIdValue | public String getIdValue(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
return idMap.get(localId);
} | java | public String getIdValue(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
return idMap.get(localId);
} | [
"public",
"String",
"getIdValue",
"(",
"final",
"URI",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URI",
"localId",
"=",
"id",
".",
"normalize",
"(",
")",
";",
"return",
"idMap",
".",
"get",
"(",
... | Return the value corresponding to the id.
@param id id
@return value | [
"Return",
"the",
"value",
"corresponding",
"to",
"the",
"id",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L101-L107 |
48,646 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.isVisited | public boolean isVisited(final URI path) {
final URI localPath = stripFragment(path).normalize();
return visitSet.contains(localPath);
} | java | public boolean isVisited(final URI path) {
final URI localPath = stripFragment(path).normalize();
return visitSet.contains(localPath);
} | [
"public",
"boolean",
"isVisited",
"(",
"final",
"URI",
"path",
")",
"{",
"final",
"URI",
"localPath",
"=",
"stripFragment",
"(",
"path",
")",
".",
"normalize",
"(",
")",
";",
"return",
"visitSet",
".",
"contains",
"(",
"localPath",
")",
";",
"}"
] | Return if this path has been visited before.
@param path topic path, may contain a fragment
@return true if has been visited | [
"Return",
"if",
"this",
"path",
"has",
"been",
"visited",
"before",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L114-L117 |
48,647 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.visit | public void visit(final URI path) {
final URI localPath = stripFragment(path).normalize();
visitSet.add(localPath);
} | java | public void visit(final URI path) {
final URI localPath = stripFragment(path).normalize();
visitSet.add(localPath);
} | [
"public",
"void",
"visit",
"(",
"final",
"URI",
"path",
")",
"{",
"final",
"URI",
"localPath",
"=",
"stripFragment",
"(",
"path",
")",
".",
"normalize",
"(",
")",
";",
"visitSet",
".",
"add",
"(",
"localPath",
")",
";",
"}"
] | Add topic to set of visited topics.
@param path topic path, may contain a fragment | [
"Add",
"topic",
"to",
"set",
"of",
"visited",
"topics",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L124-L127 |
48,648 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.getFirstTopicId | public String getFirstTopicId(final URI file, final boolean useCatalog) {
assert file.isAbsolute();
if (!(new File(file).exists())) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
... | java | public String getFirstTopicId(final URI file, final boolean useCatalog) {
assert file.isAbsolute();
if (!(new File(file).exists())) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
... | [
"public",
"String",
"getFirstTopicId",
"(",
"final",
"URI",
"file",
",",
"final",
"boolean",
"useCatalog",
")",
"{",
"assert",
"file",
".",
"isAbsolute",
"(",
")",
";",
"if",
"(",
"!",
"(",
"new",
"File",
"(",
"file",
")",
".",
"exists",
"(",
")",
")... | Get the first topic id.
@param file file URI
@param useCatalog whether use catalog file for validation
@return topic id | [
"Get",
"the",
"first",
"topic",
"id",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L136-L154 |
48,649 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/DitaIndexWriter.java | DitaIndexWriter.checkMatch | private boolean checkMatch() {
if (matchList == null) {
return true;
}
final int matchSize = matchList.size();
final int ancestorSize = topicIdList.size();
final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
return matchList.... | java | private boolean checkMatch() {
if (matchList == null) {
return true;
}
final int matchSize = matchList.size();
final int ancestorSize = topicIdList.size();
final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
return matchList.... | [
"private",
"boolean",
"checkMatch",
"(",
")",
"{",
"if",
"(",
"matchList",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"int",
"matchSize",
"=",
"matchList",
".",
"size",
"(",
")",
";",
"final",
"int",
"ancestorSize",
"=",
"topicIdList",
... | check whether the hierarchy of current node match the matchList | [
"check",
"whether",
"the",
"hierarchy",
"of",
"current",
"node",
"match",
"the",
"matchList"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/DitaIndexWriter.java#L95-L103 |
48,650 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/DitaIndexWriter.java | DitaIndexWriter.writeStartElement | private void writeStartElement(final String qName, final Attributes atts) throws IOException {
final int attsLen = atts.getLength();
output.write(LESS_THAN + qName);
for (int i = 0; i < attsLen; i++) {
final String attQName = atts.getQName(i);
final String attValue = esca... | java | private void writeStartElement(final String qName, final Attributes atts) throws IOException {
final int attsLen = atts.getLength();
output.write(LESS_THAN + qName);
for (int i = 0; i < attsLen; i++) {
final String attQName = atts.getQName(i);
final String attValue = esca... | [
"private",
"void",
"writeStartElement",
"(",
"final",
"String",
"qName",
",",
"final",
"Attributes",
"atts",
")",
"throws",
"IOException",
"{",
"final",
"int",
"attsLen",
"=",
"atts",
".",
"getLength",
"(",
")",
";",
"output",
".",
"write",
"(",
"LESS_THAN",... | SAX serializer methods | [
"SAX",
"serializer",
"methods"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/DitaIndexWriter.java#L339-L348 |
48,651 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.readExtensions | private String readExtensions(final String featureName) {
final Set<String> exts = new HashSet<>();
if (featureTable.containsKey(featureName)) {
for (final Value ext : featureTable.get(featureName)) {
final String e = ext.value.trim();
if (e.length() != 0) {
... | java | private String readExtensions(final String featureName) {
final Set<String> exts = new HashSet<>();
if (featureTable.containsKey(featureName)) {
for (final Value ext : featureTable.get(featureName)) {
final String e = ext.value.trim();
if (e.length() != 0) {
... | [
"private",
"String",
"readExtensions",
"(",
"final",
"String",
"featureName",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"exts",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"featureTable",
".",
"containsKey",
"(",
"featureName",
")",
")",
"... | Read plug-in feature.
@param featureName plug-in feature name
@return combined list of values | [
"Read",
"plug",
"-",
"in",
"feature",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L678-L689 |
48,652 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.loadPlugin | private boolean loadPlugin(final String plugin) {
if (checkPlugin(plugin)) {
final Features pluginFeatures = pluginTable.get(plugin);
final Map<String, List<String>> featureSet = pluginFeatures.getAllFeatures();
for (final Map.Entry<String, List<String>> currentFeature : feat... | java | private boolean loadPlugin(final String plugin) {
if (checkPlugin(plugin)) {
final Features pluginFeatures = pluginTable.get(plugin);
final Map<String, List<String>> featureSet = pluginFeatures.getAllFeatures();
for (final Map.Entry<String, List<String>> currentFeature : feat... | [
"private",
"boolean",
"loadPlugin",
"(",
"final",
"String",
"plugin",
")",
"{",
"if",
"(",
"checkPlugin",
"(",
"plugin",
")",
")",
"{",
"final",
"Features",
"pluginFeatures",
"=",
"pluginTable",
".",
"get",
"(",
"plugin",
")",
";",
"final",
"Map",
"<",
"... | Load the plug-ins and aggregate them by feature and fill into feature
table.
@param plugin plugin ID
@return {@code true}> if plugin was loaded, otherwise {@code false} | [
"Load",
"the",
"plug",
"-",
"ins",
"and",
"aggregate",
"them",
"by",
"feature",
"and",
"fill",
"into",
"feature",
"table",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L698-L734 |
48,653 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.checkPlugin | private boolean checkPlugin(final String currentPlugin) {
final Features pluginFeatures = pluginTable.get(currentPlugin);
final Iterator<PluginRequirement> iter = pluginFeatures.getRequireListIter();
// check whether dependcy is satisfied
while (iter.hasNext()) {
boolean anyP... | java | private boolean checkPlugin(final String currentPlugin) {
final Features pluginFeatures = pluginTable.get(currentPlugin);
final Iterator<PluginRequirement> iter = pluginFeatures.getRequireListIter();
// check whether dependcy is satisfied
while (iter.hasNext()) {
boolean anyP... | [
"private",
"boolean",
"checkPlugin",
"(",
"final",
"String",
"currentPlugin",
")",
"{",
"final",
"Features",
"pluginFeatures",
"=",
"pluginTable",
".",
"get",
"(",
"currentPlugin",
")",
";",
"final",
"Iterator",
"<",
"PluginRequirement",
">",
"iter",
"=",
"plugi... | Check whether the plugin can be loaded.
@param currentPlugin plugin ID
@return {@code true} if plugin can be loaded, otherwise {@code false} | [
"Check",
"whether",
"the",
"plugin",
"can",
"be",
"loaded",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L742-L769 |
48,654 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.mergePlugins | private void mergePlugins() {
final Element root = pluginsDoc.createElement(ELEM_PLUGINS);
pluginsDoc.appendChild(root);
if (!descSet.isEmpty()) {
final URI b = new File(ditaDir, CONFIG_DIR + File.separator + "plugins.xml").toURI();
for (final File descFile : descSet) {
... | java | private void mergePlugins() {
final Element root = pluginsDoc.createElement(ELEM_PLUGINS);
pluginsDoc.appendChild(root);
if (!descSet.isEmpty()) {
final URI b = new File(ditaDir, CONFIG_DIR + File.separator + "plugins.xml").toURI();
for (final File descFile : descSet) {
... | [
"private",
"void",
"mergePlugins",
"(",
")",
"{",
"final",
"Element",
"root",
"=",
"pluginsDoc",
".",
"createElement",
"(",
"ELEM_PLUGINS",
")",
";",
"pluginsDoc",
".",
"appendChild",
"(",
"root",
")",
";",
"if",
"(",
"!",
"descSet",
".",
"isEmpty",
"(",
... | Merge plugin configuration files. | [
"Merge",
"plugin",
"configuration",
"files",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L797-L812 |
48,655 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.parseDesc | private Element parseDesc(final File descFile) {
try {
parser.setPluginDir(descFile.getParentFile());
final Element root = parser.parse(descFile.getAbsoluteFile());
final Features f = parser.getFeatures();
final String id = f.getPluginId();
validatePlu... | java | private Element parseDesc(final File descFile) {
try {
parser.setPluginDir(descFile.getParentFile());
final Element root = parser.parse(descFile.getAbsoluteFile());
final Features f = parser.getFeatures();
final String id = f.getPluginId();
validatePlu... | [
"private",
"Element",
"parseDesc",
"(",
"final",
"File",
"descFile",
")",
"{",
"try",
"{",
"parser",
".",
"setPluginDir",
"(",
"descFile",
".",
"getParentFile",
"(",
")",
")",
";",
"final",
"Element",
"root",
"=",
"parser",
".",
"parse",
"(",
"descFile",
... | Parse plugin configuration file
@param descFile plugin configuration | [
"Parse",
"plugin",
"configuration",
"file"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L830-L848 |
48,656 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.validatePlugin | private void validatePlugin(final Features f) {
final String id = f.getPluginId();
if (!ID_PATTERN.matcher(id).matches()) {
final String msg = "Plug-in ID '" + id + "' doesn't follow syntax rules.";
throw new IllegalArgumentException(msg);
}
final List<String> ver... | java | private void validatePlugin(final Features f) {
final String id = f.getPluginId();
if (!ID_PATTERN.matcher(id).matches()) {
final String msg = "Plug-in ID '" + id + "' doesn't follow syntax rules.";
throw new IllegalArgumentException(msg);
}
final List<String> ver... | [
"private",
"void",
"validatePlugin",
"(",
"final",
"Features",
"f",
")",
"{",
"final",
"String",
"id",
"=",
"f",
".",
"getPluginId",
"(",
")",
";",
"if",
"(",
"!",
"ID_PATTERN",
".",
"matcher",
"(",
"id",
")",
".",
"matches",
"(",
")",
")",
"{",
"f... | Validate plug-in configuration.
Follow OSGi symbolic name syntax rules:
<pre>
digit ::= [0..9]
alpha ::= [a..zA..Z]
alphanum ::= alpha | digit
token ::= ( alphanum | '_' | '-' )+
symbolic-name ::= token('.'token)*
</pre>
Follow OSGi bundle version syntax rules:
<pre>
version ::= major... | [
"Validate",
"plug",
"-",
"in",
"configuration",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L875-L886 |
48,657 | dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.getValue | static String getValue(final Map<String, Features> featureTable, final String extension) {
final List<String> buf = new ArrayList<>();
for (final Features f : featureTable.values()) {
final List<String> v = f.getFeature(extension);
if (v != null) {
buf.addAll(v);
... | java | static String getValue(final Map<String, Features> featureTable, final String extension) {
final List<String> buf = new ArrayList<>();
for (final Features f : featureTable.values()) {
final List<String> v = f.getFeature(extension);
if (v != null) {
buf.addAll(v);
... | [
"static",
"String",
"getValue",
"(",
"final",
"Map",
"<",
"String",
",",
"Features",
">",
"featureTable",
",",
"final",
"String",
"extension",
")",
"{",
"final",
"List",
"<",
"String",
">",
"buf",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(... | Get all and combine extension values
@param featureTable plugin features
@param extension extension ID
@return combined extension value, {@code null} if no value available | [
"Get",
"all",
"and",
"combine",
"extension",
"values"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L914-L927 |
48,658 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.toList | public static <T> List<T> toList(final NodeList nodes) {
final List<T> res = new ArrayList<>(nodes.getLength());
for (int i = 0; i < nodes.getLength(); i++) {
res.add((T) nodes.item(i));
}
return res;
} | java | public static <T> List<T> toList(final NodeList nodes) {
final List<T> res = new ArrayList<>(nodes.getLength());
for (int i = 0; i < nodes.getLength(); i++) {
res.add((T) nodes.item(i));
}
return res;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"final",
"NodeList",
"nodes",
")",
"{",
"final",
"List",
"<",
"T",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
"nodes",
".",
"getLength",
"(",
")",
")",
";",
"for",
"(",... | Convert DOM NodeList to List. | [
"Convert",
"DOM",
"NodeList",
"to",
"List",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L67-L73 |
48,659 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getPrefix | public static String getPrefix(final String qname) {
final int sep = qname.indexOf(':');
return sep != -1 ? qname.substring(0, sep) : DEFAULT_NS_PREFIX;
} | java | public static String getPrefix(final String qname) {
final int sep = qname.indexOf(':');
return sep != -1 ? qname.substring(0, sep) : DEFAULT_NS_PREFIX;
} | [
"public",
"static",
"String",
"getPrefix",
"(",
"final",
"String",
"qname",
")",
"{",
"final",
"int",
"sep",
"=",
"qname",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"return",
"sep",
"!=",
"-",
"1",
"?",
"qname",
".",
"substring",
"(",
"0",
",",
"sep... | Get prefix from QName. | [
"Get",
"prefix",
"from",
"QName",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L87-L90 |
48,660 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getChildElements | public static List<Element> getChildElements(final Element elem, final DitaClass cls, final boolean deep) {
final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
final List<Element> res = new ArrayList<>(children.getLength());
for (int i = 0; i < children.getLen... | java | public static List<Element> getChildElements(final Element elem, final DitaClass cls, final boolean deep) {
final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
final List<Element> res = new ArrayList<>(children.getLength());
for (int i = 0; i < children.getLen... | [
"public",
"static",
"List",
"<",
"Element",
">",
"getChildElements",
"(",
"final",
"Element",
"elem",
",",
"final",
"DitaClass",
"cls",
",",
"final",
"boolean",
"deep",
")",
"{",
"final",
"NodeList",
"children",
"=",
"deep",
"?",
"elem",
".",
"getElementsByT... | List descendant elements by DITA class.
@param elem root element
@param cls DITA class to match elements
@param deep {@code true} to read descendants, {@code false} to read only direct children
@return list of matching elements | [
"List",
"descendant",
"elements",
"by",
"DITA",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L100-L110 |
48,661 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getChildElement | public static Optional<Element> getChildElement(final Element elem, final String ns, final String name) {
final NodeList children = elem.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node child = children.item(i);
if (child.getNodeType() == Node.ELEMENT_... | java | public static Optional<Element> getChildElement(final Element elem, final String ns, final String name) {
final NodeList children = elem.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node child = children.item(i);
if (child.getNodeType() == Node.ELEMENT_... | [
"public",
"static",
"Optional",
"<",
"Element",
">",
"getChildElement",
"(",
"final",
"Element",
"elem",
",",
"final",
"String",
"ns",
",",
"final",
"String",
"name",
")",
"{",
"final",
"NodeList",
"children",
"=",
"elem",
".",
"getChildNodes",
"(",
")",
"... | Get first child element by element name.
@param elem root element
@param ns namespace URI, {@code null} for empty namespace
@param name element name to match element
@return matching element | [
"Get",
"first",
"child",
"element",
"by",
"element",
"name",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L120-L131 |
48,662 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getChildElement | public static Optional<Element> getChildElement(final Element elem, final DitaClass cls) {
final NodeList children = elem.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node child = children.item(i);
if (cls.matches(child)) {
return Option... | java | public static Optional<Element> getChildElement(final Element elem, final DitaClass cls) {
final NodeList children = elem.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node child = children.item(i);
if (cls.matches(child)) {
return Option... | [
"public",
"static",
"Optional",
"<",
"Element",
">",
"getChildElement",
"(",
"final",
"Element",
"elem",
",",
"final",
"DitaClass",
"cls",
")",
"{",
"final",
"NodeList",
"children",
"=",
"elem",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
... | Get first child element by DITA class.
@param elem root element
@param cls DITA class to match element
@return matching element | [
"Get",
"first",
"child",
"element",
"by",
"DITA",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L140-L149 |
48,663 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getChildElements | public static List<Element> getChildElements(final Element elem, final String ns, final String name) {
final NodeList children = elem.getChildNodes();
final List<Element> res = new ArrayList<>(children.getLength());
for (int i = 0; i < children.getLength(); i++) {
final Node child =... | java | public static List<Element> getChildElements(final Element elem, final String ns, final String name) {
final NodeList children = elem.getChildNodes();
final List<Element> res = new ArrayList<>(children.getLength());
for (int i = 0; i < children.getLength(); i++) {
final Node child =... | [
"public",
"static",
"List",
"<",
"Element",
">",
"getChildElements",
"(",
"final",
"Element",
"elem",
",",
"final",
"String",
"ns",
",",
"final",
"String",
"name",
")",
"{",
"final",
"NodeList",
"children",
"=",
"elem",
".",
"getChildNodes",
"(",
")",
";",... | List child elements by element name.
@param ns namespace URL, {@code null} for empty namespace
@param elem root element
@param name element local name to match elements
@return list of matching elements | [
"List",
"child",
"elements",
"by",
"element",
"name",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L159-L171 |
48,664 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getChildElements | public static List<Element> getChildElements(final Element elem, final DitaClass cls) {
return getChildElements(elem, cls, false);
} | java | public static List<Element> getChildElements(final Element elem, final DitaClass cls) {
return getChildElements(elem, cls, false);
} | [
"public",
"static",
"List",
"<",
"Element",
">",
"getChildElements",
"(",
"final",
"Element",
"elem",
",",
"final",
"DitaClass",
"cls",
")",
"{",
"return",
"getChildElements",
"(",
"elem",
",",
"cls",
",",
"false",
")",
";",
"}"
] | List child elements by DITA class.
@param elem root element
@param cls DITA class to match elements
@return list of matching elements | [
"List",
"child",
"elements",
"by",
"DITA",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L180-L182 |
48,665 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getChildElements | public static List<Element> getChildElements(final Element elem, final boolean deep) {
final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
final List<Element> res = new ArrayList<>(children.getLength());
for (int i = 0; i < children.getLength(); i++) {
... | java | public static List<Element> getChildElements(final Element elem, final boolean deep) {
final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
final List<Element> res = new ArrayList<>(children.getLength());
for (int i = 0; i < children.getLength(); i++) {
... | [
"public",
"static",
"List",
"<",
"Element",
">",
"getChildElements",
"(",
"final",
"Element",
"elem",
",",
"final",
"boolean",
"deep",
")",
"{",
"final",
"NodeList",
"children",
"=",
"deep",
"?",
"elem",
".",
"getElementsByTagName",
"(",
"\"*\"",
")",
":",
... | List child elements elements.
@param elem root element
@param deep {@code true} to read descendants, {@code false} to read only direct children
@return list of matching elements | [
"List",
"child",
"elements",
"elements",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L201-L211 |
48,666 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getElementNode | public static Element getElementNode(final Element element, final DitaClass classValue) {
final NodeList list = element.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
final Node node = list.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
fin... | java | public static Element getElementNode(final Element element, final DitaClass classValue) {
final NodeList list = element.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
final Node node = list.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
fin... | [
"public",
"static",
"Element",
"getElementNode",
"(",
"final",
"Element",
"element",
",",
"final",
"DitaClass",
"classValue",
")",
"{",
"final",
"NodeList",
"list",
"=",
"element",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",... | Get specific element node from child nodes.
@param element parent node
@param classValue DITA class to search for
@return element node, {@code null} if not found | [
"Get",
"specific",
"element",
"node",
"from",
"child",
"nodes",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L241-L253 |
48,667 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getText | public static String getText(final Node root) {
if (root == null) {
return "";
} else {
final StringBuilder result = new StringBuilder(1024);
if (root.hasChildNodes()) {
final NodeList list = root.getChildNodes();
for (int i = 0; i < li... | java | public static String getText(final Node root) {
if (root == null) {
return "";
} else {
final StringBuilder result = new StringBuilder(1024);
if (root.hasChildNodes()) {
final NodeList list = root.getChildNodes();
for (int i = 0; i < li... | [
"public",
"static",
"String",
"getText",
"(",
"final",
"Node",
"root",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"else",
"{",
"final",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"1024",
")",
";",... | Get text value of a node.
@param root root node
@return text value | [
"Get",
"text",
"value",
"of",
"a",
"node",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L274-L299 |
48,668 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.searchForNode | public static Element searchForNode(final Element root, final String searchKey, final String attrName,
final DitaClass classValue) {
if (root == null) {
return null;
}
final Queue<Element> queue = new LinkedList<>();
queue.offer(root);
... | java | public static Element searchForNode(final Element root, final String searchKey, final String attrName,
final DitaClass classValue) {
if (root == null) {
return null;
}
final Queue<Element> queue = new LinkedList<>();
queue.offer(root);
... | [
"public",
"static",
"Element",
"searchForNode",
"(",
"final",
"Element",
"root",
",",
"final",
"String",
"searchKey",
",",
"final",
"String",
"attrName",
",",
"final",
"DitaClass",
"classValue",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"{",
"return",
... | Search for the special kind of node by specialized value. Equivalent to XPath
<pre>$root//*[contains(@class, $classValue)][@*[name() = $attrName and . = $searchKey]]</pre>
@param root place may have the node.
@param searchKey keyword for search.
@param attrName attribute name for search.
@param classValue cl... | [
"Search",
"for",
"the",
"special",
"kind",
"of",
"node",
"by",
"specialized",
"value",
".",
"Equivalent",
"to",
"XPath"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L312-L340 |
48,669 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.addOrSetAttribute | public static void addOrSetAttribute(final AttributesImpl atts, final String uri, final String localName,
final String qName, final String type, final String value) {
final int i = atts.getIndex(qName);
if (i != -1) {
atts.setAttribute(i, uri, localName, qName, type, value);
... | java | public static void addOrSetAttribute(final AttributesImpl atts, final String uri, final String localName,
final String qName, final String type, final String value) {
final int i = atts.getIndex(qName);
if (i != -1) {
atts.setAttribute(i, uri, localName, qName, type, value);
... | [
"public",
"static",
"void",
"addOrSetAttribute",
"(",
"final",
"AttributesImpl",
"atts",
",",
"final",
"String",
"uri",
",",
"final",
"String",
"localName",
",",
"final",
"String",
"qName",
",",
"final",
"String",
"type",
",",
"final",
"String",
"value",
")",
... | Add or set attribute.
@param atts attributes
@param uri namespace URI
@param localName local name
@param qName qualified name
@param type attribute type
@param value attribute value | [
"Add",
"or",
"set",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L352-L360 |
48,670 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.removeAttribute | public static void removeAttribute(final AttributesImpl atts, final String qName) {
final int i = atts.getIndex(qName);
if (i != -1) {
atts.removeAttribute(i);
}
} | java | public static void removeAttribute(final AttributesImpl atts, final String qName) {
final int i = atts.getIndex(qName);
if (i != -1) {
atts.removeAttribute(i);
}
} | [
"public",
"static",
"void",
"removeAttribute",
"(",
"final",
"AttributesImpl",
"atts",
",",
"final",
"String",
"qName",
")",
"{",
"final",
"int",
"i",
"=",
"atts",
".",
"getIndex",
"(",
"qName",
")",
";",
"if",
"(",
"i",
"!=",
"-",
"1",
")",
"{",
"at... | Remove an attribute from the list. Do nothing if attribute does not exist.
@param atts attributes
@param qName QName of the attribute to remove | [
"Remove",
"an",
"attribute",
"from",
"the",
"list",
".",
"Do",
"nothing",
"if",
"attribute",
"does",
"not",
"exist",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L417-L422 |
48,671 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getStringValue | public static String getStringValue(final Element element) {
final StringBuilder buf = new StringBuilder();
final NodeList children = element.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node n = children.item(i);
switch (n.getNodeType()) {
... | java | public static String getStringValue(final Element element) {
final StringBuilder buf = new StringBuilder();
final NodeList children = element.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node n = children.item(i);
switch (n.getNodeType()) {
... | [
"public",
"static",
"String",
"getStringValue",
"(",
"final",
"Element",
"element",
")",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"NodeList",
"children",
"=",
"element",
".",
"getChildNodes",
"(",
")",
";",
"... | Get element node string value.
@param element element to get string value for
@return concatenated text node descendant values | [
"Get",
"element",
"node",
"string",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L430-L445 |
48,672 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.transform | public void transform(final URI input, final List<XMLFilter> filters) throws DITAOTException {
assert input.isAbsolute();
if (!input.getScheme().equals("file")) {
throw new IllegalArgumentException("Only file URI scheme supported: " + input);
}
transform(new File(input), fil... | java | public void transform(final URI input, final List<XMLFilter> filters) throws DITAOTException {
assert input.isAbsolute();
if (!input.getScheme().equals("file")) {
throw new IllegalArgumentException("Only file URI scheme supported: " + input);
}
transform(new File(input), fil... | [
"public",
"void",
"transform",
"(",
"final",
"URI",
"input",
",",
"final",
"List",
"<",
"XMLFilter",
">",
"filters",
")",
"throws",
"DITAOTException",
"{",
"assert",
"input",
".",
"isAbsolute",
"(",
")",
";",
"if",
"(",
"!",
"input",
".",
"getScheme",
"(... | Transform file with XML filters. Only file URIs are supported.
@param input absolute URI to transform and replace
@param filters XML filters to transform file with, may be an empty list | [
"Transform",
"file",
"with",
"XML",
"filters",
".",
"Only",
"file",
"URIs",
"are",
"supported",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L453-L460 |
48,673 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.close | public static void close(final Source input) throws IOException {
if (input != null && input instanceof StreamSource) {
final StreamSource s = (StreamSource) input;
final InputStream i = s.getInputStream();
if (i != null) {
i.close();
} else {
... | java | public static void close(final Source input) throws IOException {
if (input != null && input instanceof StreamSource) {
final StreamSource s = (StreamSource) input;
final InputStream i = s.getInputStream();
if (i != null) {
i.close();
} else {
... | [
"public",
"static",
"void",
"close",
"(",
"final",
"Source",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
"!=",
"null",
"&&",
"input",
"instanceof",
"StreamSource",
")",
"{",
"final",
"StreamSource",
"s",
"=",
"(",
"StreamSource",
")",
"... | Close source. | [
"Close",
"source",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L600-L613 |
48,674 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.close | public static void close(final Result result) throws IOException {
if (result != null && result instanceof StreamResult) {
final StreamResult r = (StreamResult) result;
final OutputStream o = r.getOutputStream();
if (o != null) {
o.close();
} else ... | java | public static void close(final Result result) throws IOException {
if (result != null && result instanceof StreamResult) {
final StreamResult r = (StreamResult) result;
final OutputStream o = r.getOutputStream();
if (o != null) {
o.close();
} else ... | [
"public",
"static",
"void",
"close",
"(",
"final",
"Result",
"result",
")",
"throws",
"IOException",
"{",
"if",
"(",
"result",
"!=",
"null",
"&&",
"result",
"instanceof",
"StreamResult",
")",
"{",
"final",
"StreamResult",
"r",
"=",
"(",
"StreamResult",
")",
... | Close result. | [
"Close",
"result",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L616-L629 |
48,675 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getXMLReader | public static XMLReader getXMLReader() throws SAXException {
XMLReader reader;
if (System.getProperty(SAX_DRIVER_PROPERTY) != null) {
return XMLReaderFactory.createXMLReader();
}
try {
Class.forName(SAX_DRIVER_DEFAULT_CLASS);
reader = XMLReaderFactory.... | java | public static XMLReader getXMLReader() throws SAXException {
XMLReader reader;
if (System.getProperty(SAX_DRIVER_PROPERTY) != null) {
return XMLReaderFactory.createXMLReader();
}
try {
Class.forName(SAX_DRIVER_DEFAULT_CLASS);
reader = XMLReaderFactory.... | [
"public",
"static",
"XMLReader",
"getXMLReader",
"(",
")",
"throws",
"SAXException",
"{",
"XMLReader",
"reader",
";",
"if",
"(",
"System",
".",
"getProperty",
"(",
"SAX_DRIVER_PROPERTY",
")",
"!=",
"null",
")",
"{",
"return",
"XMLReaderFactory",
".",
"createXMLR... | Get preferred SAX parser.
Preferred XML readers are in order:
<ol>
<li>{@link Constants#SAX_DRIVER_DEFAULT_CLASS Xerces}</li>
<li>{@link Constants#SAX_DRIVER_SUN_HACK_CLASS Sun's Xerces}</li>
<li>{@link Constants#SAX_DRIVER_CRIMSON_CLASS Crimson}</li>
</ol>
@return XML parser instance.
@throws org.xml.sax.SAXExcepti... | [
"Get",
"preferred",
"SAX",
"parser",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L695-L720 |
48,676 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getDocumentBuilder | public static DocumentBuilder getDocumentBuilder() {
DocumentBuilder builder;
try {
builder = factory.newDocumentBuilder();
} catch (final ParserConfigurationException e) {
throw new RuntimeException(e);
}
if (Configuration.DEBUG) {
builder = n... | java | public static DocumentBuilder getDocumentBuilder() {
DocumentBuilder builder;
try {
builder = factory.newDocumentBuilder();
} catch (final ParserConfigurationException e) {
throw new RuntimeException(e);
}
if (Configuration.DEBUG) {
builder = n... | [
"public",
"static",
"DocumentBuilder",
"getDocumentBuilder",
"(",
")",
"{",
"DocumentBuilder",
"builder",
";",
"try",
"{",
"builder",
"=",
"factory",
".",
"newDocumentBuilder",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"ParserConfigurationException",
"e",
")",
... | Get DOM parser.
@return DOM document builder instance.
@throws RuntimeException if instantiating DocumentBuilder failed | [
"Get",
"DOM",
"parser",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L728-L739 |
48,677 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.getCascadeValue | public static String getCascadeValue(final Element elem, final String attrName) {
Element current = elem;
while (current != null) {
final Attr attr = current.getAttributeNode(attrName);
if (attr != null) {
return attr.getValue();
}
final No... | java | public static String getCascadeValue(final Element elem, final String attrName) {
Element current = elem;
while (current != null) {
final Attr attr = current.getAttributeNode(attrName);
if (attr != null) {
return attr.getValue();
}
final No... | [
"public",
"static",
"String",
"getCascadeValue",
"(",
"final",
"Element",
"elem",
",",
"final",
"String",
"attrName",
")",
"{",
"Element",
"current",
"=",
"elem",
";",
"while",
"(",
"current",
"!=",
"null",
")",
"{",
"final",
"Attr",
"attr",
"=",
"current"... | Get cascaded attribute value.
@param elem attribute parent element
@param attrName attribute name
@return attribute value, {@code null} if not set | [
"Get",
"cascaded",
"attribute",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L1020-L1035 |
48,678 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.ancestors | public static Stream<Element> ancestors(final Element element) {
final Stream.Builder<Element> builder = Stream.builder();
for (Node current = element.getParentNode(); current != null; current = current.getParentNode()) {
if (current.getNodeType() == Node.ELEMENT_NODE) {
buil... | java | public static Stream<Element> ancestors(final Element element) {
final Stream.Builder<Element> builder = Stream.builder();
for (Node current = element.getParentNode(); current != null; current = current.getParentNode()) {
if (current.getNodeType() == Node.ELEMENT_NODE) {
buil... | [
"public",
"static",
"Stream",
"<",
"Element",
">",
"ancestors",
"(",
"final",
"Element",
"element",
")",
"{",
"final",
"Stream",
".",
"Builder",
"<",
"Element",
">",
"builder",
"=",
"Stream",
".",
"builder",
"(",
")",
";",
"for",
"(",
"Node",
"current",
... | Stream of element ancestor elements.
@param element start element
@return stream of ancestor elements | [
"Stream",
"of",
"element",
"ancestor",
"elements",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L1042-L1050 |
48,679 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/ModuleFactory.java | ModuleFactory.createModule | public AbstractPipelineModule createModule(final Class<? extends AbstractPipelineModule> moduleClass)
throws DITAOTException {
try {
return moduleClass.newInstance();
} catch (final Exception e) {
final MessageBean msgBean = MessageUtils.getMessage("DOTJ005F", moduleC... | java | public AbstractPipelineModule createModule(final Class<? extends AbstractPipelineModule> moduleClass)
throws DITAOTException {
try {
return moduleClass.newInstance();
} catch (final Exception e) {
final MessageBean msgBean = MessageUtils.getMessage("DOTJ005F", moduleC... | [
"public",
"AbstractPipelineModule",
"createModule",
"(",
"final",
"Class",
"<",
"?",
"extends",
"AbstractPipelineModule",
">",
"moduleClass",
")",
"throws",
"DITAOTException",
"{",
"try",
"{",
"return",
"moduleClass",
".",
"newInstance",
"(",
")",
";",
"}",
"catch... | Create the ModuleElem class instance according to moduleName.
@param moduleClass module class
@return AbstractPipelineModule
@throws DITAOTException DITAOTException
@since 1.6 | [
"Create",
"the",
"ModuleElem",
"class",
"instance",
"according",
"to",
"moduleName",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/ModuleFactory.java#L52-L62 |
48,680 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/CatalogUtils.java | CatalogUtils.getCatalogResolver | public static synchronized CatalogResolver getCatalogResolver() {
if (catalogResolver == null) {
final CatalogManager manager = new CatalogManager();
manager.setIgnoreMissingProperties(true);
manager.setUseStaticCatalog(false); // We'll use a private catalog.
mana... | java | public static synchronized CatalogResolver getCatalogResolver() {
if (catalogResolver == null) {
final CatalogManager manager = new CatalogManager();
manager.setIgnoreMissingProperties(true);
manager.setUseStaticCatalog(false); // We'll use a private catalog.
mana... | [
"public",
"static",
"synchronized",
"CatalogResolver",
"getCatalogResolver",
"(",
")",
"{",
"if",
"(",
"catalogResolver",
"==",
"null",
")",
"{",
"final",
"CatalogManager",
"manager",
"=",
"new",
"CatalogManager",
"(",
")",
";",
"manager",
".",
"setIgnoreMissingPr... | Get CatalogResolver.
@return CatalogResolver | [
"Get",
"CatalogResolver",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/CatalogUtils.java#L50-L63 |
48,681 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.setup | public void setup(final LinkedHashMap<URI, URI> changeTable, final Map<URI, URI> conflictTable,
final Element rootTopicref,
final ChunkFilenameGenerator chunkFilenameGenerator) {
this.changeTable = changeTable;
this.rootTopicref = rootTopicref;
this.co... | java | public void setup(final LinkedHashMap<URI, URI> changeTable, final Map<URI, URI> conflictTable,
final Element rootTopicref,
final ChunkFilenameGenerator chunkFilenameGenerator) {
this.changeTable = changeTable;
this.rootTopicref = rootTopicref;
this.co... | [
"public",
"void",
"setup",
"(",
"final",
"LinkedHashMap",
"<",
"URI",
",",
"URI",
">",
"changeTable",
",",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"conflictTable",
",",
"final",
"Element",
"rootTopicref",
",",
"final",
"ChunkFilenameGenerator",
"chunkFile... | Set up the class.
@param changeTable changeTable
@param conflictTable conflictTable
@param rootTopicref chunking topicref | [
"Set",
"up",
"the",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L110-L117 |
48,682 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.generateOutputFile | URI generateOutputFile(final URI ref) {
final FileInfo srcFi = job.getFileInfo(ref);
final URI newSrc = srcFi.src.resolve(generateFilename());
final URI tmp = tempFileNameScheme.generateTempFileName(newSrc);
if (job.getFileInfo(tmp) == null) {
job.add(new FileInfo.Builder()
... | java | URI generateOutputFile(final URI ref) {
final FileInfo srcFi = job.getFileInfo(ref);
final URI newSrc = srcFi.src.resolve(generateFilename());
final URI tmp = tempFileNameScheme.generateTempFileName(newSrc);
if (job.getFileInfo(tmp) == null) {
job.add(new FileInfo.Builder()
... | [
"URI",
"generateOutputFile",
"(",
"final",
"URI",
"ref",
")",
"{",
"final",
"FileInfo",
"srcFi",
"=",
"job",
".",
"getFileInfo",
"(",
"ref",
")",
";",
"final",
"URI",
"newSrc",
"=",
"srcFi",
".",
"src",
".",
"resolve",
"(",
"generateFilename",
"(",
")",
... | Generate output file.
@return absolute temporary file | [
"Generate",
"output",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L334-L347 |
48,683 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.createTopicMeta | Element createTopicMeta(final Element topic) {
final Document doc = rootTopicref.getOwnerDocument();
final Element topicmeta = doc.createElement(MAP_TOPICMETA.localName);
topicmeta.setAttribute(ATTRIBUTE_NAME_CLASS, MAP_TOPICMETA.toString());
// iterate the node.
if (topic != nu... | java | Element createTopicMeta(final Element topic) {
final Document doc = rootTopicref.getOwnerDocument();
final Element topicmeta = doc.createElement(MAP_TOPICMETA.localName);
topicmeta.setAttribute(ATTRIBUTE_NAME_CLASS, MAP_TOPICMETA.toString());
// iterate the node.
if (topic != nu... | [
"Element",
"createTopicMeta",
"(",
"final",
"Element",
"topic",
")",
"{",
"final",
"Document",
"doc",
"=",
"rootTopicref",
".",
"getOwnerDocument",
"(",
")",
";",
"final",
"Element",
"topicmeta",
"=",
"doc",
".",
"createElement",
"(",
"MAP_TOPICMETA",
".",
"lo... | Create topicmeta node.
@param topic document element of a topic file.
@return created and populated topicmeta | [
"Create",
"topicmeta",
"node",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L355-L407 |
48,684 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.getFirstTopicId | String getFirstTopicId(final File ditaTopicFile) {
assert ditaTopicFile.isAbsolute();
if (!ditaTopicFile.isAbsolute()) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
try {
... | java | String getFirstTopicId(final File ditaTopicFile) {
assert ditaTopicFile.isAbsolute();
if (!ditaTopicFile.isAbsolute()) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
try {
... | [
"String",
"getFirstTopicId",
"(",
"final",
"File",
"ditaTopicFile",
")",
"{",
"assert",
"ditaTopicFile",
".",
"isAbsolute",
"(",
")",
";",
"if",
"(",
"!",
"ditaTopicFile",
".",
"isAbsolute",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"final",
"StringB... | Get the first topic id from the given dita file.
@param ditaTopicFile a dita file.
@return The first topic id from the given dita file if success, otherwise
{@code null} string is returned. | [
"Get",
"the",
"first",
"topic",
"id",
"from",
"the",
"given",
"dita",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L416-L436 |
48,685 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.writeStartDocument | void writeStartDocument(final Writer output) throws SAXException {
try {
output.write(XML_HEAD);
} catch (IOException e) {
throw new SAXException(e);
}
} | java | void writeStartDocument(final Writer output) throws SAXException {
try {
output.write(XML_HEAD);
} catch (IOException e) {
throw new SAXException(e);
}
} | [
"void",
"writeStartDocument",
"(",
"final",
"Writer",
"output",
")",
"throws",
"SAXException",
"{",
"try",
"{",
"output",
".",
"write",
"(",
"XML_HEAD",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"SAXException",
"(",
"e",
... | Convenience method to write document start. | [
"Convenience",
"method",
"to",
"write",
"document",
"start",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L443-L449 |
48,686 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java | AbstractChunkTopicParser.writeProcessingInstruction | void writeProcessingInstruction(final Writer output, final String name, final String value)
throws SAXException {
try {
output.write(LESS_THAN);
output.write(QUESTION);
output.write(name);
if (value != null) {
output.write(STRING_BLANK)... | java | void writeProcessingInstruction(final Writer output, final String name, final String value)
throws SAXException {
try {
output.write(LESS_THAN);
output.write(QUESTION);
output.write(name);
if (value != null) {
output.write(STRING_BLANK)... | [
"void",
"writeProcessingInstruction",
"(",
"final",
"Writer",
"output",
",",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"throws",
"SAXException",
"{",
"try",
"{",
"output",
".",
"write",
"(",
"LESS_THAN",
")",
";",
"output",
".",
"write... | Convenience method to write a processing instruction.
@param name PI name
@param value PI value, may be {@code null} | [
"Convenience",
"method",
"to",
"write",
"a",
"processing",
"instruction",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractChunkTopicParser.java#L496-L511 |
48,687 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ChunkTopicParser.java | ChunkTopicParser.insertAfter | private void insertAfter(final URI hrefValue, final StringBuffer parentResult, final CharSequence tmpContent) {
int insertpoint = parentResult.lastIndexOf("</");
final int end = parentResult.indexOf(">", insertpoint);
if (insertpoint == -1 || end == -1) {
logger.error(MessageUtils.g... | java | private void insertAfter(final URI hrefValue, final StringBuffer parentResult, final CharSequence tmpContent) {
int insertpoint = parentResult.lastIndexOf("</");
final int end = parentResult.indexOf(">", insertpoint);
if (insertpoint == -1 || end == -1) {
logger.error(MessageUtils.g... | [
"private",
"void",
"insertAfter",
"(",
"final",
"URI",
"hrefValue",
",",
"final",
"StringBuffer",
"parentResult",
",",
"final",
"CharSequence",
"tmpContent",
")",
"{",
"int",
"insertpoint",
"=",
"parentResult",
".",
"lastIndexOf",
"(",
"\"</\"",
")",
";",
"final... | Append XML content into root element
@param hrefValue href of the topicref
@param parentResult XML content to insert into
@param tmpContent XML content to insert | [
"Append",
"XML",
"content",
"into",
"root",
"element"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ChunkTopicParser.java#L279-L291 |
48,688 | dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ChunkTopicParser.java | ChunkTopicParser.writeToContentChunk | private void writeToContentChunk(final String tmpContent, final URI outputFileName, final boolean needWriteDitaTag) throws IOException {
assert outputFileName.isAbsolute();
logger.info("Writing " + outputFileName);
try (OutputStreamWriter ditaFileOutput = new OutputStreamWriter(new FileOutputStr... | java | private void writeToContentChunk(final String tmpContent, final URI outputFileName, final boolean needWriteDitaTag) throws IOException {
assert outputFileName.isAbsolute();
logger.info("Writing " + outputFileName);
try (OutputStreamWriter ditaFileOutput = new OutputStreamWriter(new FileOutputStr... | [
"private",
"void",
"writeToContentChunk",
"(",
"final",
"String",
"tmpContent",
",",
"final",
"URI",
"outputFileName",
",",
"final",
"boolean",
"needWriteDitaTag",
")",
"throws",
"IOException",
"{",
"assert",
"outputFileName",
".",
"isAbsolute",
"(",
")",
";",
"lo... | flush the buffer to file after processing is finished | [
"flush",
"the",
"buffer",
"to",
"file",
"after",
"processing",
"is",
"finished"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ChunkTopicParser.java#L294-L339 |
48,689 | dita-ot/dita-ot | src/main/java/org/dita/dost/index/Messages.java | Messages.getString | public static String getString (final String key, final Locale msgLocale) {
/*read message resource file.*/
ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, msgLocale);
try {
return RESOURCE_BUNDLE.getString(key);
} catch (final MissingResourceException ... | java | public static String getString (final String key, final Locale msgLocale) {
/*read message resource file.*/
ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, msgLocale);
try {
return RESOURCE_BUNDLE.getString(key);
} catch (final MissingResourceException ... | [
"public",
"static",
"String",
"getString",
"(",
"final",
"String",
"key",
",",
"final",
"Locale",
"msgLocale",
")",
"{",
"/*read message resource file.*/",
"ResourceBundle",
"RESOURCE_BUNDLE",
"=",
"ResourceBundle",
".",
"getBundle",
"(",
"BUNDLE_NAME",
",",
"msgLocal... | get specific message by key and locale.
@param key key
@param msgLocale locale
@return string | [
"get",
"specific",
"message",
"by",
"key",
"and",
"locale",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/index/Messages.java#L33-L41 |
48,690 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/DelayConrefUtils.java | DelayConrefUtils.findTopicId | public boolean findTopicId(final File absolutePathToFile, final String id) {
if (!absolutePathToFile.exists()) {
return false;
}
try {
//load the file
final DocumentBuilder builder = XMLUtils.getDocumentBuilder();
builder.setEntityResolver(Catalog... | java | public boolean findTopicId(final File absolutePathToFile, final String id) {
if (!absolutePathToFile.exists()) {
return false;
}
try {
//load the file
final DocumentBuilder builder = XMLUtils.getDocumentBuilder();
builder.setEntityResolver(Catalog... | [
"public",
"boolean",
"findTopicId",
"(",
"final",
"File",
"absolutePathToFile",
",",
"final",
"String",
"id",
")",
"{",
"if",
"(",
"!",
"absolutePathToFile",
".",
"exists",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"//load the file",
"fi... | Find whether an id is refer to a topic in a dita file.
@param absolutePathToFile the absolute path of dita file
@param id topic id
@return true if id find and false otherwise | [
"Find",
"whether",
"an",
"id",
"is",
"refer",
"to",
"a",
"topic",
"in",
"a",
"dita",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DelayConrefUtils.java#L82-L122 |
48,691 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/DelayConrefUtils.java | DelayConrefUtils.searchForKey | private Element searchForKey(final Element root, final String key, final String tagName) {
if (root == null || StringUtils.isEmptyString(key)) {
return null;
}
final Queue<Element> queue = new LinkedList<>();
queue.offer(root);
while (!queue.isEmpty()) {
... | java | private Element searchForKey(final Element root, final String key, final String tagName) {
if (root == null || StringUtils.isEmptyString(key)) {
return null;
}
final Queue<Element> queue = new LinkedList<>();
queue.offer(root);
while (!queue.isEmpty()) {
... | [
"private",
"Element",
"searchForKey",
"(",
"final",
"Element",
"root",
",",
"final",
"String",
"key",
",",
"final",
"String",
"tagName",
")",
"{",
"if",
"(",
"root",
"==",
"null",
"||",
"StringUtils",
".",
"isEmptyString",
"(",
"key",
")",
")",
"{",
"ret... | Search specific element by key and tagName.
@param root root element
@param key search keyword
@param tagName search tag name
@return search result, null of either input is invalid or the looking result is not found. | [
"Search",
"specific",
"element",
"by",
"key",
"and",
"tagName",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DelayConrefUtils.java#L192-L224 |
48,692 | dita-ot/dita-ot | src/main/java/org/dita/dost/util/DelayConrefUtils.java | DelayConrefUtils.writeMapToXML | public void writeMapToXML(final Map<String, Set<String>> m) {
final File outputFile = new File(job.tempDir, FILE_NAME_PLUGIN_XML);
if (m == null) {
return;
}
final Properties prop = new Properties();
for (Map.Entry<String, Set<String>> entry : m.entrySet()) {
... | java | public void writeMapToXML(final Map<String, Set<String>> m) {
final File outputFile = new File(job.tempDir, FILE_NAME_PLUGIN_XML);
if (m == null) {
return;
}
final Properties prop = new Properties();
for (Map.Entry<String, Set<String>> entry : m.entrySet()) {
... | [
"public",
"void",
"writeMapToXML",
"(",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"m",
")",
"{",
"final",
"File",
"outputFile",
"=",
"new",
"File",
"(",
"job",
".",
"tempDir",
",",
"FILE_NAME_PLUGIN_XML",
")",
";",
"if",
"(",
... | Write map into xml file.
@param m map | [
"Write",
"map",
"into",
"xml",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DelayConrefUtils.java#L229-L283 |
48,693 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java | AbstractBranchFilterModule.getSubjectScheme | SubjectScheme getSubjectScheme(final Element root) {
subjectSchemeReader.reset();
logger.debug("Loading subject schemes");
final List<Element> subjectSchemes = toList(root.getElementsByTagName("*"));
subjectSchemes.stream()
.filter(SUBJECTSCHEME_ENUMERATIONDEF::matches)
... | java | SubjectScheme getSubjectScheme(final Element root) {
subjectSchemeReader.reset();
logger.debug("Loading subject schemes");
final List<Element> subjectSchemes = toList(root.getElementsByTagName("*"));
subjectSchemes.stream()
.filter(SUBJECTSCHEME_ENUMERATIONDEF::matches)
... | [
"SubjectScheme",
"getSubjectScheme",
"(",
"final",
"Element",
"root",
")",
"{",
"subjectSchemeReader",
".",
"reset",
"(",
")",
";",
"logger",
".",
"debug",
"(",
"\"Loading subject schemes\"",
")",
";",
"final",
"List",
"<",
"Element",
">",
"subjectSchemes",
"=",... | Read subject scheme definitions. | [
"Read",
"subject",
"scheme",
"definitions",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java#L76-L90 |
48,694 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java | AbstractBranchFilterModule.combineFilterUtils | List<FilterUtils> combineFilterUtils(final Element topicref, final List<FilterUtils> filters,
final SubjectScheme subjectSchemeMap) {
return getChildElement(topicref, DITAVAREF_D_DITAVALREF)
.map(ditavalRef -> getFilterUtils(ditavalRef).refine(subjectSche... | java | List<FilterUtils> combineFilterUtils(final Element topicref, final List<FilterUtils> filters,
final SubjectScheme subjectSchemeMap) {
return getChildElement(topicref, DITAVAREF_D_DITAVALREF)
.map(ditavalRef -> getFilterUtils(ditavalRef).refine(subjectSche... | [
"List",
"<",
"FilterUtils",
">",
"combineFilterUtils",
"(",
"final",
"Element",
"topicref",
",",
"final",
"List",
"<",
"FilterUtils",
">",
"filters",
",",
"final",
"SubjectScheme",
"subjectSchemeMap",
")",
"{",
"return",
"getChildElement",
"(",
"topicref",
",",
... | Combine referenced DITAVAL to existing list and refine with subject scheme. | [
"Combine",
"referenced",
"DITAVAL",
"to",
"existing",
"list",
"and",
"refine",
"with",
"subject",
"scheme",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java#L95-L106 |
48,695 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java | AbstractBranchFilterModule.getFilterUtils | private FilterUtils getFilterUtils(final Element ditavalRef) {
final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
final URI tmp = currentFile.resolve(href);
final FileInfo fi = job.getFileInfo(tmp);
final URI ditaval = fi.src;
return filterCache.computeIfAbsent... | java | private FilterUtils getFilterUtils(final Element ditavalRef) {
final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
final URI tmp = currentFile.resolve(href);
final FileInfo fi = job.getFileInfo(tmp);
final URI ditaval = fi.src;
return filterCache.computeIfAbsent... | [
"private",
"FilterUtils",
"getFilterUtils",
"(",
"final",
"Element",
"ditavalRef",
")",
"{",
"final",
"URI",
"href",
"=",
"toURI",
"(",
"ditavalRef",
".",
"getAttribute",
"(",
"ATTRIBUTE_NAME_HREF",
")",
")",
";",
"final",
"URI",
"tmp",
"=",
"currentFile",
"."... | Read referenced DITAVAL and cache filter. | [
"Read",
"referenced",
"DITAVAL",
"and",
"cache",
"filter",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java#L111-L117 |
48,696 | dita-ot/dita-ot | src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java | AbstractBranchFilterModule.getFilterUtils | FilterUtils getFilterUtils(final URI ditaval) {
logger.info("Reading " + ditaval);
ditaValReader.filterReset();
ditaValReader.read(ditaval);
flagImageSet.addAll(ditaValReader.getImageList());
relFlagImagesSet.addAll(ditaValReader.getRelFlagImageList());
Map<FilterUtils.Fi... | java | FilterUtils getFilterUtils(final URI ditaval) {
logger.info("Reading " + ditaval);
ditaValReader.filterReset();
ditaValReader.read(ditaval);
flagImageSet.addAll(ditaValReader.getImageList());
relFlagImagesSet.addAll(ditaValReader.getRelFlagImageList());
Map<FilterUtils.Fi... | [
"FilterUtils",
"getFilterUtils",
"(",
"final",
"URI",
"ditaval",
")",
"{",
"logger",
".",
"info",
"(",
"\"Reading \"",
"+",
"ditaval",
")",
";",
"ditaValReader",
".",
"filterReset",
"(",
")",
";",
"ditaValReader",
".",
"read",
"(",
"ditaval",
")",
";",
"fl... | Read DITAVAL file. | [
"Read",
"DITAVAL",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/filter/AbstractBranchFilterModule.java#L125-L135 |
48,697 | dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GrammarPoolManager.java | GrammarPoolManager.getGrammarPool | public static XMLGrammarPool getGrammarPool() {
XMLGrammarPool pool = grammarPool.get();
if (pool == null) {
try {
pool = new XMLGrammarPoolImplUtils();
grammarPool.set(pool);
} catch (final Exception e) {
System.out.println("Failed... | java | public static XMLGrammarPool getGrammarPool() {
XMLGrammarPool pool = grammarPool.get();
if (pool == null) {
try {
pool = new XMLGrammarPoolImplUtils();
grammarPool.set(pool);
} catch (final Exception e) {
System.out.println("Failed... | [
"public",
"static",
"XMLGrammarPool",
"getGrammarPool",
"(",
")",
"{",
"XMLGrammarPool",
"pool",
"=",
"grammarPool",
".",
"get",
"(",
")",
";",
"if",
"(",
"pool",
"==",
"null",
")",
"{",
"try",
"{",
"pool",
"=",
"new",
"XMLGrammarPoolImplUtils",
"(",
")",
... | Get grammar pool
@return grammar pool instance | [
"Get",
"grammar",
"pool"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GrammarPoolManager.java#L27-L38 |
48,698 | dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.correct | private static String correct(String url) {
// Fix for bad URLs containing UNC paths
// If the url is a UNC file url it must be specified like:
// file:////<PATH>...
if (url.startsWith("file://")
// A url like file:///<PATH> refers to a local file so it must not be
// modified.
&& !url.s... | java | private static String correct(String url) {
// Fix for bad URLs containing UNC paths
// If the url is a UNC file url it must be specified like:
// file:////<PATH>...
if (url.startsWith("file://")
// A url like file:///<PATH> refers to a local file so it must not be
// modified.
&& !url.s... | [
"private",
"static",
"String",
"correct",
"(",
"String",
"url",
")",
"{",
"// Fix for bad URLs containing UNC paths",
"// If the url is a UNC file url it must be specified like:",
"// file:////<PATH>...",
"if",
"(",
"url",
".",
"startsWith",
"(",
"\"file://\"",
")",
"// A url... | Method introduced to correct the URLs in the default machine encoding. This
was needed by the xsltproc, the catalogs URLs must be encoded in the
machine encoding.
@param url
The URL to be corrected. If it contains a % char, it means it
already was corrected, so it will be returned. Take care at
composing URLs from a c... | [
"Method",
"introduced",
"to",
"correct",
"the",
"URLs",
"in",
"the",
"default",
"machine",
"encoding",
".",
"This",
"was",
"needed",
"by",
"the",
"xsltproc",
"the",
"catalogs",
"URLs",
"must",
"be",
"encoded",
"in",
"the",
"machine",
"encoding",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L176-L268 |
48,699 | dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.getUserInfo | private static String getUserInfo(String url) {
String userInfo = null;
int startIndex = Integer.MIN_VALUE;
int nextSlashIndex = Integer.MIN_VALUE;
int endIndex = Integer.MIN_VALUE;
try {
// The user info start index should be the first index of "//".
startIndex = url.indexOf("//");
... | java | private static String getUserInfo(String url) {
String userInfo = null;
int startIndex = Integer.MIN_VALUE;
int nextSlashIndex = Integer.MIN_VALUE;
int endIndex = Integer.MIN_VALUE;
try {
// The user info start index should be the first index of "//".
startIndex = url.indexOf("//");
... | [
"private",
"static",
"String",
"getUserInfo",
"(",
"String",
"url",
")",
"{",
"String",
"userInfo",
"=",
"null",
";",
"int",
"startIndex",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"int",
"nextSlashIndex",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"int",
"endIndex... | Extract the user info from an URL.
@param url
The string representing the URL.
@return The userinfo or null if cannot extract it. | [
"Extract",
"the",
"user",
"info",
"from",
"an",
"URL",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L277-L308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.