repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.extractUser | private static String extractUser(String userInfo) {
if (userInfo == null) {
return null;
}
int index = userInfo.lastIndexOf(':');
if (index == -1) {
return userInfo;
} else {
return userInfo.substring(0, index);
}
} | java | private static String extractUser(String userInfo) {
if (userInfo == null) {
return null;
}
int index = userInfo.lastIndexOf(':');
if (index == -1) {
return userInfo;
} else {
return userInfo.substring(0, index);
}
} | [
"private",
"static",
"String",
"extractUser",
"(",
"String",
"userInfo",
")",
"{",
"if",
"(",
"userInfo",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"index",
"=",
"userInfo",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"in... | Gets the user from an userInfo string obtained from the starting URL. Used
only by the constructor.
@param userInfo
userInfo, taken from the URL.
@return The user. | [
"Gets",
"the",
"user",
"from",
"an",
"userInfo",
"string",
"obtained",
"from",
"the",
"starting",
"URL",
".",
"Used",
"only",
"by",
"the",
"constructor",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L318-L329 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.extractPassword | private static String extractPassword(String userInfo) {
if (userInfo == null) {
return null;
}
String password = "";
int index = userInfo.lastIndexOf(':');
if (index != -1 && index < userInfo.length() - 1) {
// Extract password from the URL.
password = userInfo.substring(index + 1... | java | private static String extractPassword(String userInfo) {
if (userInfo == null) {
return null;
}
String password = "";
int index = userInfo.lastIndexOf(':');
if (index != -1 && index < userInfo.length() - 1) {
// Extract password from the URL.
password = userInfo.substring(index + 1... | [
"private",
"static",
"String",
"extractPassword",
"(",
"String",
"userInfo",
")",
"{",
"if",
"(",
"userInfo",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"password",
"=",
"\"\"",
";",
"int",
"index",
"=",
"userInfo",
".",
"lastIndexOf",
... | Gets the password from an user info string obtained from the starting URL.
@param userInfo
userInfo, taken from the URL. If no user info specified returning
null. If user info not null but no password after ":" then
returning empty, (we have a user so the default pass for him is
empty string). See bug 6086.
@return T... | [
"Gets",
"the",
"password",
"from",
"an",
"user",
"info",
"string",
"obtained",
"from",
"the",
"starting",
"URL",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L342-L353 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.clearUserInfo | private static URL clearUserInfo(String systemID) {
try {
URL url = new URL(systemID);
// Do not clear user info on "file" urls 'cause on Windows the drive will
// have no ":"...
if (!"file".equals(url.getProtocol())) {
return attachUserInfo(url, null, null);
}
return url... | java | private static URL clearUserInfo(String systemID) {
try {
URL url = new URL(systemID);
// Do not clear user info on "file" urls 'cause on Windows the drive will
// have no ":"...
if (!"file".equals(url.getProtocol())) {
return attachUserInfo(url, null, null);
}
return url... | [
"private",
"static",
"URL",
"clearUserInfo",
"(",
"String",
"systemID",
")",
"{",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"systemID",
")",
";",
"// Do not clear user info on \"file\" urls 'cause on Windows the drive will",
"// have no \":\"...",
"if",
"(",
"... | Clears the user info from an url.
@param systemID
the url to be cleaned.
@return the cleaned url, or null if the argument is not an URL. | [
"Clears",
"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#L362-L374 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.attachUserInfo | private static URL attachUserInfo(URL url, String user, char[] password)
throws MalformedURLException {
if (url == null) {
return null;
}
if ((url.getAuthority() == null || "".equals(url.getAuthority()))
&& !"jar".equals(url.getProtocol())) {
return url;
}
StringBuilder bu... | java | private static URL attachUserInfo(URL url, String user, char[] password)
throws MalformedURLException {
if (url == null) {
return null;
}
if ((url.getAuthority() == null || "".equals(url.getAuthority()))
&& !"jar".equals(url.getProtocol())) {
return url;
}
StringBuilder bu... | [
"private",
"static",
"URL",
"attachUserInfo",
"(",
"URL",
"url",
",",
"String",
"user",
",",
"char",
"[",
"]",
"password",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"("... | Build the URL from the data obtained from the user.
@param url
The URL to be transformed.
@param user
The user name.
@param password
The password.
@return The URL with userInfo.
@exception MalformedURLException
Exception thrown if the URL is malformed. | [
"Build",
"the",
"URL",
"from",
"the",
"data",
"obtained",
"from",
"the",
"user",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L389-L439 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.correctUser | private static String correctUser(String user) {
if (user != null && user.trim().length() > 0
&& (false || user.indexOf('%') == -1)) {
String escaped = escapeSpecialAsciiAndNonAscii(user);
StringBuilder totalEscaped = new StringBuilder();
for (int i = 0; i < escaped.length(); i++) {
... | java | private static String correctUser(String user) {
if (user != null && user.trim().length() > 0
&& (false || user.indexOf('%') == -1)) {
String escaped = escapeSpecialAsciiAndNonAscii(user);
StringBuilder totalEscaped = new StringBuilder();
for (int i = 0; i < escaped.length(); i++) {
... | [
"private",
"static",
"String",
"correctUser",
"(",
"String",
"user",
")",
"{",
"if",
"(",
"user",
"!=",
"null",
"&&",
"user",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
"&&",
"(",
"false",
"||",
"user",
".",
"indexOf",
"(",
"'",
"'... | Escape the specified user.
@param user
The user name to correct.
@return The escaped user. | [
"Escape",
"the",
"specified",
"user",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L448-L465 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/Util.java | Util.correctPassword | private static char[] correctPassword(char[] password) {
if (password != null && new String(password).indexOf('%') == -1) {
String escaped = escapeSpecialAsciiAndNonAscii(new String(password));
StringBuilder totalEscaped = new StringBuilder();
for (int i = 0; i < escaped.length(); i++) {
c... | java | private static char[] correctPassword(char[] password) {
if (password != null && new String(password).indexOf('%') == -1) {
String escaped = escapeSpecialAsciiAndNonAscii(new String(password));
StringBuilder totalEscaped = new StringBuilder();
for (int i = 0; i < escaped.length(); i++) {
c... | [
"private",
"static",
"char",
"[",
"]",
"correctPassword",
"(",
"char",
"[",
"]",
"password",
")",
"{",
"if",
"(",
"password",
"!=",
"null",
"&&",
"new",
"String",
"(",
"password",
")",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
... | Escape the specified password.
@param password
The password to be corrected.
@return The escaped password. | [
"Escape",
"the",
"specified",
"password",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/Util.java#L475-L491 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.read | private void read() throws IOException {
lastModified = jobFile.lastModified();
if (jobFile.exists()) {
try (final InputStream in = new FileInputStream(jobFile)) {
final XMLReader parser = XMLUtils.getXMLReader();
parser.setContentHandler(new JobHandler(prop, ... | java | private void read() throws IOException {
lastModified = jobFile.lastModified();
if (jobFile.exists()) {
try (final InputStream in = new FileInputStream(jobFile)) {
final XMLReader parser = XMLUtils.getXMLReader();
parser.setContentHandler(new JobHandler(prop, ... | [
"private",
"void",
"read",
"(",
")",
"throws",
"IOException",
"{",
"lastModified",
"=",
"jobFile",
".",
"lastModified",
"(",
")",
";",
"if",
"(",
"jobFile",
".",
"exists",
"(",
")",
")",
"{",
"try",
"(",
"final",
"InputStream",
"in",
"=",
"new",
"FileI... | Read temporary configuration files. If configuration files are not found,
assume an empty job object is being created.
@throws IOException if reading configuration files failed
@throws IllegalStateException if configuration files are missing | [
"Read",
"temporary",
"configuration",
"files",
".",
"If",
"configuration",
"files",
"are",
"not",
"found",
"assume",
"an",
"empty",
"job",
"object",
"is",
"being",
"created",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L168-L185 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getProperties | public Map<String, String> getProperties() {
final Map<String, String> res = new HashMap<>();
for (final Map.Entry<String, Object> e: prop.entrySet()) {
if (e.getValue() instanceof String) {
res.put(e.getKey(), (String) e.getValue());
}
}
return Co... | java | public Map<String, String> getProperties() {
final Map<String, String> res = new HashMap<>();
for (final Map.Entry<String, Object> e: prop.entrySet()) {
if (e.getValue() instanceof String) {
res.put(e.getKey(), (String) e.getValue());
}
}
return Co... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getProperties",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"res",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
... | Get a map of string properties.
@return map of properties, may be an empty map | [
"Get",
"a",
"map",
"of",
"string",
"properties",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L426-L434 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.setProperty | public Object setProperty(final String key, final String value) {
return prop.put(key, value);
} | java | public Object setProperty(final String key, final String value) {
return prop.put(key, value);
} | [
"public",
"Object",
"setProperty",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"return",
"prop",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set property value.
@param key property key
@param value property value
@return the previous value of the specified key in this property list, or {@code null} if it did not have one | [
"Set",
"property",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L443-L445 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getInputMap | public URI getInputMap() {
// return toURI(getProperty(INPUT_DITAMAP_URI));
return files.values().stream()
.filter(fi -> fi.isInput)
.map(fi -> getInputDir().relativize(fi.src))
.findAny()
.orElse(null);
} | java | public URI getInputMap() {
// return toURI(getProperty(INPUT_DITAMAP_URI));
return files.values().stream()
.filter(fi -> fi.isInput)
.map(fi -> getInputDir().relativize(fi.src))
.findAny()
.orElse(null);
} | [
"public",
"URI",
"getInputMap",
"(",
")",
"{",
"// return toURI(getProperty(INPUT_DITAMAP_URI));",
"return",
"files",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"fi",
"->",
"fi",
".",
"isInput",
")",
".",
"map",
"(",
"fi",
... | Get input file
@return input file path relative to input directory, {@code null} if not set | [
"Get",
"input",
"file"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L452-L459 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.setInputMap | public void setInputMap(final URI map) {
assert !map.isAbsolute();
setProperty(INPUT_DITAMAP_URI, map.toString());
// Deprecated since 2.2
setProperty(INPUT_DITAMAP, toFile(map).getPath());
} | java | public void setInputMap(final URI map) {
assert !map.isAbsolute();
setProperty(INPUT_DITAMAP_URI, map.toString());
// Deprecated since 2.2
setProperty(INPUT_DITAMAP, toFile(map).getPath());
} | [
"public",
"void",
"setInputMap",
"(",
"final",
"URI",
"map",
")",
"{",
"assert",
"!",
"map",
".",
"isAbsolute",
"(",
")",
";",
"setProperty",
"(",
"INPUT_DITAMAP_URI",
",",
"map",
".",
"toString",
"(",
")",
")",
";",
"// Deprecated since 2.2",
"setProperty",... | set input file
@param map input file path relative to input directory | [
"set",
"input",
"file"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L466-L471 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.setInputDir | public void setInputDir(final URI dir) {
assert dir.isAbsolute();
setProperty(INPUT_DIR_URI, dir.toString());
// Deprecated since 2.2
if (dir.getScheme().equals("file")) {
setProperty(INPUT_DIR, new File(dir).getAbsolutePath());
}
} | java | public void setInputDir(final URI dir) {
assert dir.isAbsolute();
setProperty(INPUT_DIR_URI, dir.toString());
// Deprecated since 2.2
if (dir.getScheme().equals("file")) {
setProperty(INPUT_DIR, new File(dir).getAbsolutePath());
}
} | [
"public",
"void",
"setInputDir",
"(",
"final",
"URI",
"dir",
")",
"{",
"assert",
"dir",
".",
"isAbsolute",
"(",
")",
";",
"setProperty",
"(",
"INPUT_DIR_URI",
",",
"dir",
".",
"toString",
"(",
")",
")",
";",
"// Deprecated since 2.2",
"if",
"(",
"dir",
"... | Set input directory
@param dir absolute input directory path | [
"Set",
"input",
"directory"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L486-L493 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getFileInfoMap | public Map<File, FileInfo> getFileInfoMap() {
final Map<File, FileInfo> ret = new HashMap<>();
for (final Map.Entry<URI, FileInfo> e: files.entrySet()) {
ret.put(e.getValue().file, e.getValue());
}
return Collections.unmodifiableMap(ret);
} | java | public Map<File, FileInfo> getFileInfoMap() {
final Map<File, FileInfo> ret = new HashMap<>();
for (final Map.Entry<URI, FileInfo> e: files.entrySet()) {
ret.put(e.getValue().file, e.getValue());
}
return Collections.unmodifiableMap(ret);
} | [
"public",
"Map",
"<",
"File",
",",
"FileInfo",
">",
"getFileInfoMap",
"(",
")",
"{",
"final",
"Map",
"<",
"File",
",",
"FileInfo",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"URI",
",",
... | Get all file info objects as a map
@return map of file info objects, where the key is the {@link FileInfo#file} value. May be empty | [
"Get",
"all",
"file",
"info",
"objects",
"as",
"a",
"map"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L500-L506 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getFileInfo | public Collection<FileInfo> getFileInfo(final Predicate<FileInfo> filter) {
return files.values().stream()
.filter(filter)
.collect(Collectors.toList());
} | java | public Collection<FileInfo> getFileInfo(final Predicate<FileInfo> filter) {
return files.values().stream()
.filter(filter)
.collect(Collectors.toList());
} | [
"public",
"Collection",
"<",
"FileInfo",
">",
"getFileInfo",
"(",
"final",
"Predicate",
"<",
"FileInfo",
">",
"filter",
")",
"{",
"return",
"files",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"filter",
")",
".",
"collect",
"(... | Get file info objects that pass the filter
@param filter filter file info object must pass
@return collection of file info objects that pass the filter, may be empty | [
"Get",
"file",
"info",
"objects",
"that",
"pass",
"the",
"filter"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L523-L527 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getFileInfo | public FileInfo getFileInfo(final URI file) {
if (file == null) {
return null;
} else if (files.containsKey(file)) {
return files.get(file);
} else if (file.isAbsolute() && file.toString().startsWith(tempDirURI.toString())) {
final URI relative = getRelativePa... | java | public FileInfo getFileInfo(final URI file) {
if (file == null) {
return null;
} else if (files.containsKey(file)) {
return files.get(file);
} else if (file.isAbsolute() && file.toString().startsWith(tempDirURI.toString())) {
final URI relative = getRelativePa... | [
"public",
"FileInfo",
"getFileInfo",
"(",
"final",
"URI",
"file",
")",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"files",
".",
"containsKey",
"(",
"file",
")",
")",
"{",
"return",
"files",
".",
"... | Get file info object
@param file file URI
@return file info object, {@code null} if not found | [
"Get",
"file",
"info",
"object"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L535-L549 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getOrCreateFileInfo | public FileInfo getOrCreateFileInfo(final URI file) {
assert file.getFragment() == null;
URI f = file.normalize();
if (f.isAbsolute()) {
f = tempDirURI.relativize(f);
}
FileInfo i = getFileInfo(file);
if (i == null) {
i = new FileInfo(f);
... | java | public FileInfo getOrCreateFileInfo(final URI file) {
assert file.getFragment() == null;
URI f = file.normalize();
if (f.isAbsolute()) {
f = tempDirURI.relativize(f);
}
FileInfo i = getFileInfo(file);
if (i == null) {
i = new FileInfo(f);
... | [
"public",
"FileInfo",
"getOrCreateFileInfo",
"(",
"final",
"URI",
"file",
")",
"{",
"assert",
"file",
".",
"getFragment",
"(",
")",
"==",
"null",
";",
"URI",
"f",
"=",
"file",
".",
"normalize",
"(",
")",
";",
"if",
"(",
"f",
".",
"isAbsolute",
"(",
"... | Get or create FileInfo for given path.
@param file relative URI to temporary directory
@return created or existing file info object | [
"Get",
"or",
"create",
"FileInfo",
"for",
"given",
"path",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L556-L568 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.setOutterControl | public void setOutterControl(final String control) {
prop.put(PROPERTY_OUTER_CONTROL, OutterControl.valueOf(control.toUpperCase()).toString());
} | java | public void setOutterControl(final String control) {
prop.put(PROPERTY_OUTER_CONTROL, OutterControl.valueOf(control.toUpperCase()).toString());
} | [
"public",
"void",
"setOutterControl",
"(",
"final",
"String",
"control",
")",
"{",
"prop",
".",
"put",
"(",
"PROPERTY_OUTER_CONTROL",
",",
"OutterControl",
".",
"valueOf",
"(",
"control",
".",
"toUpperCase",
"(",
")",
")",
".",
"toString",
"(",
")",
")",
"... | Set the outercontrol.
@param control control | [
"Set",
"the",
"outercontrol",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L874-L876 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.crawlTopics | public boolean crawlTopics() {
if (prop.get(PROPERTY_LINK_CRAWLER) == null) {
return true;
}
return prop.get(PROPERTY_LINK_CRAWLER).toString().equals(ANT_INVOKER_EXT_PARAM_CRAWL_VALUE_TOPIC);
} | java | public boolean crawlTopics() {
if (prop.get(PROPERTY_LINK_CRAWLER) == null) {
return true;
}
return prop.get(PROPERTY_LINK_CRAWLER).toString().equals(ANT_INVOKER_EXT_PARAM_CRAWL_VALUE_TOPIC);
} | [
"public",
"boolean",
"crawlTopics",
"(",
")",
"{",
"if",
"(",
"prop",
".",
"get",
"(",
"PROPERTY_LINK_CRAWLER",
")",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"prop",
".",
"get",
"(",
"PROPERTY_LINK_CRAWLER",
")",
".",
"toString",
"("... | Retrieve the link crawling behaviour.
@return {@code true} if crawl links in topics, {@code false} if only crawl links in maps | [
"Retrieve",
"the",
"link",
"crawling",
"behaviour",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L890-L895 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getOutputDir | public File getOutputDir() {
if (prop.containsKey(PROPERTY_OUTPUT_DIR)) {
return new File(prop.get(PROPERTY_OUTPUT_DIR).toString());
}
return null;
} | java | public File getOutputDir() {
if (prop.containsKey(PROPERTY_OUTPUT_DIR)) {
return new File(prop.get(PROPERTY_OUTPUT_DIR).toString());
}
return null;
} | [
"public",
"File",
"getOutputDir",
"(",
")",
"{",
"if",
"(",
"prop",
".",
"containsKey",
"(",
"PROPERTY_OUTPUT_DIR",
")",
")",
"{",
"return",
"new",
"File",
"(",
"prop",
".",
"get",
"(",
"PROPERTY_OUTPUT_DIR",
")",
".",
"toString",
"(",
")",
")",
";",
"... | Get output dir.
@return absolute output dir | [
"Get",
"output",
"dir",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L939-L944 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getInputFile | public URI getInputFile() {
// if (prop.containsKey(PROPERTY_INPUT_MAP_URI)) {
// return toURI(prop.get(PROPERTY_INPUT_MAP_URI).toString());
// }
// return null;
return files.values().stream()
.filter(fi -> fi.isInput)
.map(fi -> fi.src)
... | java | public URI getInputFile() {
// if (prop.containsKey(PROPERTY_INPUT_MAP_URI)) {
// return toURI(prop.get(PROPERTY_INPUT_MAP_URI).toString());
// }
// return null;
return files.values().stream()
.filter(fi -> fi.isInput)
.map(fi -> fi.src)
... | [
"public",
"URI",
"getInputFile",
"(",
")",
"{",
"// if (prop.containsKey(PROPERTY_INPUT_MAP_URI)) {",
"// return toURI(prop.get(PROPERTY_INPUT_MAP_URI).toString());",
"// }",
"// return null;",
"return",
"files",
".",
"values",
"(",
")",
".",
"stream... | Get input file path.
@return absolute input file path, {@code null} if not set | [
"Get",
"input",
"file",
"path",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L958-L969 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.setInputFile | public void setInputFile(final URI inputFile) {
assert inputFile.isAbsolute();
prop.put(PROPERTY_INPUT_MAP_URI, inputFile.toString());
// Deprecated since 2.1
if (inputFile.getScheme().equals("file")) {
prop.put(PROPERTY_INPUT_MAP, new File(inputFile).getAbsolutePath());
... | java | public void setInputFile(final URI inputFile) {
assert inputFile.isAbsolute();
prop.put(PROPERTY_INPUT_MAP_URI, inputFile.toString());
// Deprecated since 2.1
if (inputFile.getScheme().equals("file")) {
prop.put(PROPERTY_INPUT_MAP, new File(inputFile).getAbsolutePath());
... | [
"public",
"void",
"setInputFile",
"(",
"final",
"URI",
"inputFile",
")",
"{",
"assert",
"inputFile",
".",
"isAbsolute",
"(",
")",
";",
"prop",
".",
"put",
"(",
"PROPERTY_INPUT_MAP_URI",
",",
"inputFile",
".",
"toString",
"(",
")",
")",
";",
"// Deprecated si... | Set input map path.
@param inputFile absolute input map path | [
"Set",
"input",
"map",
"path",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L975-L982 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/Job.java | Job.getTempFileNameScheme | public TempFileNameScheme getTempFileNameScheme() {
final TempFileNameScheme tempFileNameScheme;
try {
final String cls = Optional
.ofNullable(getProperty("temp-file-name-scheme"))
.orElse(configuration.get("temp-file-name-scheme"));
tempFi... | java | public TempFileNameScheme getTempFileNameScheme() {
final TempFileNameScheme tempFileNameScheme;
try {
final String cls = Optional
.ofNullable(getProperty("temp-file-name-scheme"))
.orElse(configuration.get("temp-file-name-scheme"));
tempFi... | [
"public",
"TempFileNameScheme",
"getTempFileNameScheme",
"(",
")",
"{",
"final",
"TempFileNameScheme",
"tempFileNameScheme",
";",
"try",
"{",
"final",
"String",
"cls",
"=",
"Optional",
".",
"ofNullable",
"(",
"getProperty",
"(",
"\"temp-file-name-scheme\"",
")",
")",
... | Get temporary file name generator. | [
"Get",
"temporary",
"file",
"name",
"generator",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L987-L999 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/util/IndexStringProcessor.java | IndexStringProcessor.processIndexString | public static IndexEntry[] processIndexString(final String theIndexMarkerString, final List<Node> contents) {
final IndexEntryImpl indexEntry = createIndexEntry(theIndexMarkerString, contents, null, false);
final StringBuffer referenceIDBuf = new StringBuffer();
referenceIDBuf.append(indexEntry.... | java | public static IndexEntry[] processIndexString(final String theIndexMarkerString, final List<Node> contents) {
final IndexEntryImpl indexEntry = createIndexEntry(theIndexMarkerString, contents, null, false);
final StringBuffer referenceIDBuf = new StringBuffer();
referenceIDBuf.append(indexEntry.... | [
"public",
"static",
"IndexEntry",
"[",
"]",
"processIndexString",
"(",
"final",
"String",
"theIndexMarkerString",
",",
"final",
"List",
"<",
"Node",
">",
"contents",
")",
"{",
"final",
"IndexEntryImpl",
"indexEntry",
"=",
"createIndexEntry",
"(",
"theIndexMarkerStri... | Parse the index marker string and create IndexEntry object from one.
@param theIndexMarkerString index marker string
@param contents IndexPreprocessorTask instance
@return IndexEntry objects created from the index string | [
"Parse",
"the",
"index",
"marker",
"string",
"and",
"create",
"IndexEntry",
"object",
"from",
"one",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/util/IndexStringProcessor.java#L53-L61 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/util/IndexStringProcessor.java | IndexStringProcessor.normalizeTextValue | public static String normalizeTextValue(final String theString) {
if (null != theString && theString.length() > 0) {
return theString.replaceAll("[\\s\\n]+", " ").trim();
}
return theString;
} | java | public static String normalizeTextValue(final String theString) {
if (null != theString && theString.length() > 0) {
return theString.replaceAll("[\\s\\n]+", " ").trim();
}
return theString;
} | [
"public",
"static",
"String",
"normalizeTextValue",
"(",
"final",
"String",
"theString",
")",
"{",
"if",
"(",
"null",
"!=",
"theString",
"&&",
"theString",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"return",
"theString",
".",
"replaceAll",
"(",
"\"[\\\\... | Method equals to the normalize-space xslt function
@param theString string to normalize
@return normalized string | [
"Method",
"equals",
"to",
"the",
"normalize",
"-",
"space",
"xslt",
"function"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/util/IndexStringProcessor.java#L70-L75 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/ant/ExtensibleAntInvoker.java | ExtensibleAntInvoker.setTempdir | public void setTempdir(final File tempdir) {
this.tempDir = tempdir.getAbsoluteFile();
attrs.put(ANT_INVOKER_PARAM_TEMPDIR, tempdir.getAbsolutePath());
} | java | public void setTempdir(final File tempdir) {
this.tempDir = tempdir.getAbsoluteFile();
attrs.put(ANT_INVOKER_PARAM_TEMPDIR, tempdir.getAbsolutePath());
} | [
"public",
"void",
"setTempdir",
"(",
"final",
"File",
"tempdir",
")",
"{",
"this",
".",
"tempDir",
"=",
"tempdir",
".",
"getAbsoluteFile",
"(",
")",
";",
"attrs",
".",
"put",
"(",
"ANT_INVOKER_PARAM_TEMPDIR",
",",
"tempdir",
".",
"getAbsolutePath",
"(",
")",... | Set temporary directory.
@param tempdir temporary directory | [
"Set",
"temporary",
"directory",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/ant/ExtensibleAntInvoker.java#L102-L105 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/ant/ExtensibleAntInvoker.java | ExtensibleAntInvoker.execute | @Override
public void execute() throws BuildException {
initialize();
final Job job = getJob(tempDir, getProject());
try {
for (final ModuleElem m : modules) {
m.setProject(getProject());
m.setLocation(getLocation());
final Pipelin... | java | @Override
public void execute() throws BuildException {
initialize();
final Job job = getJob(tempDir, getProject());
try {
for (final ModuleElem m : modules) {
m.setProject(getProject());
m.setLocation(getLocation());
final Pipelin... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"BuildException",
"{",
"initialize",
"(",
")",
";",
"final",
"Job",
"job",
"=",
"getJob",
"(",
"tempDir",
",",
"getProject",
"(",
")",
")",
";",
"try",
"{",
"for",
"(",
"final",
"ModuleE... | Execution point of this invoker.
@throws BuildException exception | [
"Execution",
"point",
"of",
"this",
"invoker",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/ant/ExtensibleAntInvoker.java#L165-L189 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/ant/ExtensibleAntInvoker.java | ExtensibleAntInvoker.getJob | public static Job getJob(final File tempDir, final Project project) {
Job job = project.getReference(ANT_REFERENCE_JOB);
if (job != null && job.isStale()) {
project.log("Reload stale job configuration reference", Project.MSG_VERBOSE);
job = null;
}
if (job == null... | java | public static Job getJob(final File tempDir, final Project project) {
Job job = project.getReference(ANT_REFERENCE_JOB);
if (job != null && job.isStale()) {
project.log("Reload stale job configuration reference", Project.MSG_VERBOSE);
job = null;
}
if (job == null... | [
"public",
"static",
"Job",
"getJob",
"(",
"final",
"File",
"tempDir",
",",
"final",
"Project",
"project",
")",
"{",
"Job",
"job",
"=",
"project",
".",
"getReference",
"(",
"ANT_REFERENCE_JOB",
")",
";",
"if",
"(",
"job",
"!=",
"null",
"&&",
"job",
".",
... | Get job configuration from Ant project reference or create new.
@param tempDir configuration directory
@param project Ant project
@return job configuration | [
"Get",
"job",
"configuration",
"from",
"Ant",
"project",
"reference",
"or",
"create",
"new",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/ant/ExtensibleAntInvoker.java#L292-L307 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/log/MessageUtils.java | MessageUtils.getMessage | public static MessageBean getMessage(final String id, final String... params) {
if (!msgs.containsKey(id)) {
throw new IllegalArgumentException("Message for ID '" + id + "' not found");
}
final String msg = MessageFormat.format(msgs.getString(id), (Object[]) params);
MessageB... | java | public static MessageBean getMessage(final String id, final String... params) {
if (!msgs.containsKey(id)) {
throw new IllegalArgumentException("Message for ID '" + id + "' not found");
}
final String msg = MessageFormat.format(msgs.getString(id), (Object[]) params);
MessageB... | [
"public",
"static",
"MessageBean",
"getMessage",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"...",
"params",
")",
"{",
"if",
"(",
"!",
"msgs",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Mess... | Get the message respond to the given id with all of the parameters
are replaced by those in the given 'prop', if no message found,
an empty message with this id will be returned.
@param id id
@param params message parameters
@return MessageBean | [
"Get",
"the",
"message",
"respond",
"to",
"the",
"given",
"id",
"with",
"all",
"of",
"the",
"parameters",
"are",
"replaced",
"by",
"those",
"in",
"the",
"given",
"prop",
"if",
"no",
"message",
"found",
"an",
"empty",
"message",
"with",
"this",
"id",
"wil... | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/log/MessageUtils.java#L57-L81 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxDefaultsParserConfiguration.java | RelaxDefaultsParserConfiguration.insertRelaxDefaultsComponent | protected void insertRelaxDefaultsComponent() {
if (fRelaxDefaults == null) {
fRelaxDefaults = new RelaxNGDefaultsComponent(resolver);
addCommonComponent(fRelaxDefaults);
fRelaxDefaults.reset(this);
}
XMLDocumentSource prev = fLastComponent;
fLastComponent = fRelaxDefaults;
... | java | protected void insertRelaxDefaultsComponent() {
if (fRelaxDefaults == null) {
fRelaxDefaults = new RelaxNGDefaultsComponent(resolver);
addCommonComponent(fRelaxDefaults);
fRelaxDefaults.reset(this);
}
XMLDocumentSource prev = fLastComponent;
fLastComponent = fRelaxDefaults;
... | [
"protected",
"void",
"insertRelaxDefaultsComponent",
"(",
")",
"{",
"if",
"(",
"fRelaxDefaults",
"==",
"null",
")",
"{",
"fRelaxDefaults",
"=",
"new",
"RelaxNGDefaultsComponent",
"(",
"resolver",
")",
";",
"addCommonComponent",
"(",
"fRelaxDefaults",
")",
";",
"fR... | Insert the Relax NG defaults component | [
"Insert",
"the",
"Relax",
"NG",
"defaults",
"component"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxDefaultsParserConfiguration.java#L135-L151 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/IndexTermReader.java | IndexTermReader.reset | public void reset() {
targetFile = null;
title = null;
defaultTitle = null;
inTitleElement = false;
termStack.clear();
topicIdStack.clear();
indexTermSpecList.clear();
indexSeeSpecList.clear();
indexSeeAlsoSpecList.clear();
indexSortAsSpecL... | java | public void reset() {
targetFile = null;
title = null;
defaultTitle = null;
inTitleElement = false;
termStack.clear();
topicIdStack.clear();
indexTermSpecList.clear();
indexSeeSpecList.clear();
indexSeeAlsoSpecList.clear();
indexSortAsSpecL... | [
"public",
"void",
"reset",
"(",
")",
"{",
"targetFile",
"=",
"null",
";",
"title",
"=",
"null",
";",
"defaultTitle",
"=",
"null",
";",
"inTitleElement",
"=",
"false",
";",
"termStack",
".",
"clear",
"(",
")",
";",
"topicIdStack",
".",
"clear",
"(",
")"... | Reset the reader. | [
"Reset",
"the",
"reader",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/IndexTermReader.java#L110-L126 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/IndexTermReader.java | IndexTermReader.genTarget | private IndexTermTarget genTarget() {
final IndexTermTarget target = new IndexTermTarget();
String fragment;
if (topicIdStack.peek() == null) {
fragment = null;
} else {
fragment = topicIdStack.peek();
}
if (title != null) {
target.se... | java | private IndexTermTarget genTarget() {
final IndexTermTarget target = new IndexTermTarget();
String fragment;
if (topicIdStack.peek() == null) {
fragment = null;
} else {
fragment = topicIdStack.peek();
}
if (title != null) {
target.se... | [
"private",
"IndexTermTarget",
"genTarget",
"(",
")",
"{",
"final",
"IndexTermTarget",
"target",
"=",
"new",
"IndexTermTarget",
"(",
")",
";",
"String",
"fragment",
";",
"if",
"(",
"topicIdStack",
".",
"peek",
"(",
")",
"==",
"null",
")",
"{",
"fragment",
"... | This method is used to create a target which refers to current topic.
@return instance of IndexTermTarget created | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"target",
"which",
"refers",
"to",
"current",
"topic",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/IndexTermReader.java#L266-L287 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/IndexTermReader.java | IndexTermReader.updateIndexTermTargetName | private void updateIndexTermTargetName() {
if (defaultTitle == null) {
defaultTitle = targetFile;
}
for (final IndexTerm indexterm : indexTermList) {
updateIndexTermTargetName(indexterm);
}
} | java | private void updateIndexTermTargetName() {
if (defaultTitle == null) {
defaultTitle = targetFile;
}
for (final IndexTerm indexterm : indexTermList) {
updateIndexTermTargetName(indexterm);
}
} | [
"private",
"void",
"updateIndexTermTargetName",
"(",
")",
"{",
"if",
"(",
"defaultTitle",
"==",
"null",
")",
"{",
"defaultTitle",
"=",
"targetFile",
";",
"}",
"for",
"(",
"final",
"IndexTerm",
"indexterm",
":",
"indexTermList",
")",
"{",
"updateIndexTermTargetNa... | Update the target name of constructed IndexTerm recursively | [
"Update",
"the",
"target",
"name",
"of",
"constructed",
"IndexTerm",
"recursively"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/IndexTermReader.java#L463-L470 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/IndexTermReader.java | IndexTermReader.updateIndexTermTargetName | private void updateIndexTermTargetName(final IndexTerm indexterm) {
final int targetSize = indexterm.getTargetList().size();
final int subtermSize = indexterm.getSubTerms().size();
for (int i = 0; i<targetSize; i++) {
final IndexTermTarget target = indexterm.getTargetList().get(i);
... | java | private void updateIndexTermTargetName(final IndexTerm indexterm) {
final int targetSize = indexterm.getTargetList().size();
final int subtermSize = indexterm.getSubTerms().size();
for (int i = 0; i<targetSize; i++) {
final IndexTermTarget target = indexterm.getTargetList().get(i);
... | [
"private",
"void",
"updateIndexTermTargetName",
"(",
"final",
"IndexTerm",
"indexterm",
")",
"{",
"final",
"int",
"targetSize",
"=",
"indexterm",
".",
"getTargetList",
"(",
")",
".",
"size",
"(",
")",
";",
"final",
"int",
"subtermSize",
"=",
"indexterm",
".",
... | Update the target name of each IndexTerm, recursively. | [
"Update",
"the",
"target",
"name",
"of",
"each",
"IndexTerm",
"recursively",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/IndexTermReader.java#L475-L497 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/IndexTermReader.java | IndexTermReader.trimSpaceAtStart | private static String trimSpaceAtStart(final String temp, final String termName) {
if (termName != null && termName.charAt(termName.length() - 1) == ' ') {
if (temp.charAt(0) == ' ') {
return temp.substring(1);
}
}
return temp;
} | java | private static String trimSpaceAtStart(final String temp, final String termName) {
if (termName != null && termName.charAt(termName.length() - 1) == ' ') {
if (temp.charAt(0) == ' ') {
return temp.substring(1);
}
}
return temp;
} | [
"private",
"static",
"String",
"trimSpaceAtStart",
"(",
"final",
"String",
"temp",
",",
"final",
"String",
"termName",
")",
"{",
"if",
"(",
"termName",
"!=",
"null",
"&&",
"termName",
".",
"charAt",
"(",
"termName",
".",
"length",
"(",
")",
"-",
"1",
")"... | Trim whitespace from start of the string. If last character of termName and
first character of temp is a space character, remove leading string from temp
@return trimmed temp value | [
"Trim",
"whitespace",
"from",
"start",
"of",
"the",
"string",
".",
"If",
"last",
"character",
"of",
"termName",
"and",
"first",
"character",
"of",
"temp",
"is",
"a",
"space",
"character",
"remove",
"leading",
"string",
"from",
"temp"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/IndexTermReader.java#L505-L512 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/ChunkModule.java | ChunkModule.execute | @Override
public AbstractPipelineOutput execute(final AbstractPipelineInput input) throws DITAOTException {
final String transtype = input.getAttribute(ANT_INVOKER_EXT_PARAM_TRANSTYPE);
// change to xml property
final ChunkMapReader mapReader = new ChunkMapReader();
mapReader.setLogg... | java | @Override
public AbstractPipelineOutput execute(final AbstractPipelineInput input) throws DITAOTException {
final String transtype = input.getAttribute(ANT_INVOKER_EXT_PARAM_TRANSTYPE);
// change to xml property
final ChunkMapReader mapReader = new ChunkMapReader();
mapReader.setLogg... | [
"@",
"Override",
"public",
"AbstractPipelineOutput",
"execute",
"(",
"final",
"AbstractPipelineInput",
"input",
")",
"throws",
"DITAOTException",
"{",
"final",
"String",
"transtype",
"=",
"input",
".",
"getAttribute",
"(",
"ANT_INVOKER_EXT_PARAM_TRANSTYPE",
")",
";",
... | Entry point of chunk module.
@param input Input parameters and resources.
@return null
@throws DITAOTException exception | [
"Entry",
"point",
"of",
"chunk",
"module",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/ChunkModule.java#L59-L97 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/ChunkModule.java | ChunkModule.hasChanges | private boolean hasChanges(final Map<URI, URI> changeTable) {
if (changeTable.isEmpty()) {
return false;
}
for (Map.Entry<URI, URI> e : changeTable.entrySet()) {
if (!e.getKey().equals(e.getValue())) {
return true;
}
}
return fa... | java | private boolean hasChanges(final Map<URI, URI> changeTable) {
if (changeTable.isEmpty()) {
return false;
}
for (Map.Entry<URI, URI> e : changeTable.entrySet()) {
if (!e.getKey().equals(e.getValue())) {
return true;
}
}
return fa... | [
"private",
"boolean",
"hasChanges",
"(",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"changeTable",
")",
"{",
"if",
"(",
"changeTable",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"Map",
".",
"Entry",
"<",
"URI",
"... | Test whether there are changes that require topic rewriting. | [
"Test",
"whether",
"there",
"are",
"changes",
"that",
"require",
"topic",
"rewriting",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/ChunkModule.java#L102-L112 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/ChunkModule.java | ChunkModule.isEclipseMap | private boolean isEclipseMap(final URI mapFile) throws DITAOTException {
final DocumentBuilder builder = getDocumentBuilder();
Document doc;
try {
doc = builder.parse(mapFile.toString());
} catch (final SAXException | IOException e) {
throw new DITAOTException("Fa... | java | private boolean isEclipseMap(final URI mapFile) throws DITAOTException {
final DocumentBuilder builder = getDocumentBuilder();
Document doc;
try {
doc = builder.parse(mapFile.toString());
} catch (final SAXException | IOException e) {
throw new DITAOTException("Fa... | [
"private",
"boolean",
"isEclipseMap",
"(",
"final",
"URI",
"mapFile",
")",
"throws",
"DITAOTException",
"{",
"final",
"DocumentBuilder",
"builder",
"=",
"getDocumentBuilder",
"(",
")",
";",
"Document",
"doc",
";",
"try",
"{",
"doc",
"=",
"builder",
".",
"parse... | Check whether ditamap is an Eclipse specialization.
@param mapFile ditamap file to test
@return {@code true} if Eclipse specialization, otherwise {@code false}
@throws DITAOTException if reading ditamap fails | [
"Check",
"whether",
"ditamap",
"is",
"an",
"Eclipse",
"specialization",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/ChunkModule.java#L121-L131 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/ChunkModule.java | ChunkModule.updateRefOfDita | private void updateRefOfDita(final Map<URI, URI> changeTable, final Map<URI, URI> conflictTable) {
final TopicRefWriter topicRefWriter = new TopicRefWriter();
topicRefWriter.setLogger(logger);
topicRefWriter.setJob(job);
topicRefWriter.setChangeTable(changeTable);
topicRefWriter.... | java | private void updateRefOfDita(final Map<URI, URI> changeTable, final Map<URI, URI> conflictTable) {
final TopicRefWriter topicRefWriter = new TopicRefWriter();
topicRefWriter.setLogger(logger);
topicRefWriter.setJob(job);
topicRefWriter.setChangeTable(changeTable);
topicRefWriter.... | [
"private",
"void",
"updateRefOfDita",
"(",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"changeTable",
",",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"conflictTable",
")",
"{",
"final",
"TopicRefWriter",
"topicRefWriter",
"=",
"new",
"TopicRefWriter",
"("... | Update href attributes in ditamap and topic files. | [
"Update",
"href",
"attributes",
"in",
"ditamap",
"and",
"topic",
"files",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/ChunkModule.java#L136-L154 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/index/IndexTermCollection.java | IndexTermCollection.addTerm | public void addTerm(final IndexTerm term) {
int i = 0;
final int termNum = termList.size();
for (; i < termNum; i++) {
final IndexTerm indexTerm = termList.get(i);
if (indexTerm.equals(term)) {
return;
}
// Add targets when same t... | java | public void addTerm(final IndexTerm term) {
int i = 0;
final int termNum = termList.size();
for (; i < termNum; i++) {
final IndexTerm indexTerm = termList.get(i);
if (indexTerm.equals(term)) {
return;
}
// Add targets when same t... | [
"public",
"void",
"addTerm",
"(",
"final",
"IndexTerm",
"term",
")",
"{",
"int",
"i",
"=",
"0",
";",
"final",
"int",
"termNum",
"=",
"termList",
".",
"size",
"(",
")",
";",
"for",
"(",
";",
"i",
"<",
"termNum",
";",
"i",
"++",
")",
"{",
"final",
... | All a new term into the collection.
@param term index term | [
"All",
"a",
"new",
"term",
"into",
"the",
"collection",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/index/IndexTermCollection.java#L99-L121 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/index/IndexTermCollection.java | IndexTermCollection.sort | public void sort() {
if (IndexTerm.getTermLocale() == null ||
IndexTerm.getTermLocale().getLanguage().trim().length() == 0) {
IndexTerm.setTermLocale(new Locale(LANGUAGE_EN,
COUNTRY_US));
}
/*
* Sort all the terms recursively
*/
... | java | public void sort() {
if (IndexTerm.getTermLocale() == null ||
IndexTerm.getTermLocale().getLanguage().trim().length() == 0) {
IndexTerm.setTermLocale(new Locale(LANGUAGE_EN,
COUNTRY_US));
}
/*
* Sort all the terms recursively
*/
... | [
"public",
"void",
"sort",
"(",
")",
"{",
"if",
"(",
"IndexTerm",
".",
"getTermLocale",
"(",
")",
"==",
"null",
"||",
"IndexTerm",
".",
"getTermLocale",
"(",
")",
".",
"getLanguage",
"(",
")",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0... | Sort term list extracted from dita files base on Locale. | [
"Sort",
"term",
"list",
"extracted",
"from",
"dita",
"files",
"base",
"on",
"Locale",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/index/IndexTermCollection.java#L135-L150 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/index/IndexTermCollection.java | IndexTermCollection.outputTerms | public void outputTerms() throws DITAOTException {
StringBuilder buff = new StringBuilder(outputFileRoot);
AbstractWriter abstractWriter = null;
if (indexClass != null && indexClass.length() > 0) {
//Instantiate the class value
Class<?> anIndexClass;
try {
... | java | public void outputTerms() throws DITAOTException {
StringBuilder buff = new StringBuilder(outputFileRoot);
AbstractWriter abstractWriter = null;
if (indexClass != null && indexClass.length() > 0) {
//Instantiate the class value
Class<?> anIndexClass;
try {
... | [
"public",
"void",
"outputTerms",
"(",
")",
"throws",
"DITAOTException",
"{",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
"outputFileRoot",
")",
";",
"AbstractWriter",
"abstractWriter",
"=",
"null",
";",
"if",
"(",
"indexClass",
"!=",
"null",
"&&",... | Output index terms into index file.
@throws DITAOTException exception | [
"Output",
"index",
"terms",
"into",
"index",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/index/IndexTermCollection.java#L157-L199 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractDitaMetaWriter.java | AbstractDitaMetaWriter.skipUnlockedNavtitle | boolean skipUnlockedNavtitle(final Element metadataContainer, final Element checkForNavtitle) {
if (!TOPIC_TITLEALTS.matches(metadataContainer) ||
!TOPIC_NAVTITLE.matches(checkForNavtitle)) {
return false;
} else if (checkForNavtitle.getAttributeNodeNS(DITA_OT_NS, ATTRIBUTE_N... | java | boolean skipUnlockedNavtitle(final Element metadataContainer, final Element checkForNavtitle) {
if (!TOPIC_TITLEALTS.matches(metadataContainer) ||
!TOPIC_NAVTITLE.matches(checkForNavtitle)) {
return false;
} else if (checkForNavtitle.getAttributeNodeNS(DITA_OT_NS, ATTRIBUTE_N... | [
"boolean",
"skipUnlockedNavtitle",
"(",
"final",
"Element",
"metadataContainer",
",",
"final",
"Element",
"checkForNavtitle",
")",
"{",
"if",
"(",
"!",
"TOPIC_TITLEALTS",
".",
"matches",
"(",
"metadataContainer",
")",
"||",
"!",
"TOPIC_NAVTITLE",
".",
"matches",
"... | Check if an element is an unlocked navtitle, which should not be pushed into topics.
@param metadataContainer container element
@param checkForNavtitle title element | [
"Check",
"if",
"an",
"element",
"is",
"an",
"unlocked",
"navtitle",
"which",
"should",
"not",
"be",
"pushed",
"into",
"topics",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractDitaMetaWriter.java#L86-L96 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/AbstractDitaMetaWriter.java | AbstractDitaMetaWriter.getNewChildren | private List<Element> getNewChildren(final DitaClass cls, final Document doc) {
final List<Element> res = new ArrayList<>();
if (metaTable.containsKey(cls.matcher)) {
metaTable.get(cls.matcher);
final NodeList list = metaTable.get(cls.matcher).getChildNodes();
for (in... | java | private List<Element> getNewChildren(final DitaClass cls, final Document doc) {
final List<Element> res = new ArrayList<>();
if (metaTable.containsKey(cls.matcher)) {
metaTable.get(cls.matcher);
final NodeList list = metaTable.get(cls.matcher).getChildNodes();
for (in... | [
"private",
"List",
"<",
"Element",
">",
"getNewChildren",
"(",
"final",
"DitaClass",
"cls",
",",
"final",
"Document",
"doc",
")",
"{",
"final",
"List",
"<",
"Element",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"metaTable",
".... | Get metadata elements to add to current document. Elements have been cloned and imported
into the current document.
@param cls element class of metadata elements
@param doc current document
@return list of metadata elements, may be empty | [
"Get",
"metadata",
"elements",
"to",
"add",
"to",
"current",
"document",
".",
"Elements",
"have",
"been",
"cloned",
"and",
"imported",
"into",
"the",
"current",
"document",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/AbstractDitaMetaWriter.java#L106-L118 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.createTopicStump | private void createTopicStump(final URI newFile) {
try (final OutputStream newFileWriter = new FileOutputStream(new File(newFile))) {
final XMLStreamWriter o = XMLOutputFactory.newInstance().createXMLStreamWriter(newFileWriter, UTF8);
o.writeStartDocument();
o.writeProcessing... | java | private void createTopicStump(final URI newFile) {
try (final OutputStream newFileWriter = new FileOutputStream(new File(newFile))) {
final XMLStreamWriter o = XMLOutputFactory.newInstance().createXMLStreamWriter(newFileWriter, UTF8);
o.writeStartDocument();
o.writeProcessing... | [
"private",
"void",
"createTopicStump",
"(",
"final",
"URI",
"newFile",
")",
"{",
"try",
"(",
"final",
"OutputStream",
"newFileWriter",
"=",
"new",
"FileOutputStream",
"(",
"new",
"File",
"(",
"newFile",
")",
")",
")",
"{",
"final",
"XMLStreamWriter",
"o",
"=... | Create the new topic stump. | [
"Create",
"the",
"new",
"topic",
"stump",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L238-L254 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.readProcessingInstructions | private void readProcessingInstructions(final Document doc) {
final NodeList docNodes = doc.getChildNodes();
for (int i = 0; i < docNodes.getLength(); i++) {
final Node node = docNodes.item(i);
if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
final Pr... | java | private void readProcessingInstructions(final Document doc) {
final NodeList docNodes = doc.getChildNodes();
for (int i = 0; i < docNodes.getLength(); i++) {
final Node node = docNodes.item(i);
if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
final Pr... | [
"private",
"void",
"readProcessingInstructions",
"(",
"final",
"Document",
"doc",
")",
"{",
"final",
"NodeList",
"docNodes",
"=",
"doc",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"docNodes",
".",
"getLength",
"... | Read processing metadata from processing instructions. | [
"Read",
"processing",
"metadata",
"from",
"processing",
"instructions",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L259-L284 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.processNavitation | private void processNavitation(final Element topicref) {
// create new map's root element
final Element root = (Element) topicref.getOwnerDocument().getDocumentElement().cloneNode(false);
// create navref element
final Element navref = topicref.getOwnerDocument().createElement(MAP_NAVREF... | java | private void processNavitation(final Element topicref) {
// create new map's root element
final Element root = (Element) topicref.getOwnerDocument().getDocumentElement().cloneNode(false);
// create navref element
final Element navref = topicref.getOwnerDocument().createElement(MAP_NAVREF... | [
"private",
"void",
"processNavitation",
"(",
"final",
"Element",
"topicref",
")",
"{",
"// create new map's root element",
"final",
"Element",
"root",
"=",
"(",
"Element",
")",
"topicref",
".",
"getOwnerDocument",
"(",
")",
".",
"getDocumentElement",
"(",
")",
"."... | Create new map and refer to it with navref. | [
"Create",
"new",
"map",
"and",
"refer",
"to",
"it",
"with",
"navref",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L383-L398 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.generateStumpTopic | private void generateStumpTopic(final Element topicref) {
final URI result = getResultFile(topicref);
final URI temp = tempFileNameScheme.generateTempFileName(result);
final URI absTemp = job.tempDir.toURI().resolve(temp);
final String name = getBaseName(new File(result).getName());
... | java | private void generateStumpTopic(final Element topicref) {
final URI result = getResultFile(topicref);
final URI temp = tempFileNameScheme.generateTempFileName(result);
final URI absTemp = job.tempDir.toURI().resolve(temp);
final String name = getBaseName(new File(result).getName());
... | [
"private",
"void",
"generateStumpTopic",
"(",
"final",
"Element",
"topicref",
")",
"{",
"final",
"URI",
"result",
"=",
"getResultFile",
"(",
"topicref",
")",
";",
"final",
"URI",
"temp",
"=",
"tempFileNameScheme",
".",
"generateTempFileName",
"(",
"result",
")",... | Generate stump topic for to-content content.
@param topicref topicref without href to generate stump topic for | [
"Generate",
"stump",
"topic",
"for",
"to",
"-",
"content",
"content",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L414-L442 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.createChildTopicrefStubs | private void createChildTopicrefStubs(final List<Element> topicrefs) {
if (!topicrefs.isEmpty()) {
for (final Element currentElem : topicrefs) {
final String href = getValue(currentElem, ATTRIBUTE_NAME_HREF);
final String chunk = getValue(currentElem,ATTRIBUTE_NAME_CH... | java | private void createChildTopicrefStubs(final List<Element> topicrefs) {
if (!topicrefs.isEmpty()) {
for (final Element currentElem : topicrefs) {
final String href = getValue(currentElem, ATTRIBUTE_NAME_HREF);
final String chunk = getValue(currentElem,ATTRIBUTE_NAME_CH... | [
"private",
"void",
"createChildTopicrefStubs",
"(",
"final",
"List",
"<",
"Element",
">",
"topicrefs",
")",
"{",
"if",
"(",
"!",
"topicrefs",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"final",
"Element",
"currentElem",
":",
"topicrefs",
")",
"{",
"... | Before combining topics in a branch, ensure any descendant topicref with @chunk and no @href has a stub | [
"Before",
"combining",
"topics",
"in",
"a",
"branch",
"ensure",
"any",
"descendant",
"topicref",
"with"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L550-L561 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.getChangeTable | public Map<URI, URI> getChangeTable() {
for (final Map.Entry<URI, URI> e : changeTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
return Collections.unmodifiableMap(changeTable);
} | java | public Map<URI, URI> getChangeTable() {
for (final Map.Entry<URI, URI> e : changeTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
return Collections.unmodifiableMap(changeTable);
} | [
"public",
"Map",
"<",
"URI",
",",
"URI",
">",
"getChangeTable",
"(",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"URI",
",",
"URI",
">",
"e",
":",
"changeTable",
".",
"entrySet",
"(",
")",
")",
"{",
"assert",
"e",
".",
"getKey",
"(",... | Get changed files table.
@return map of changed files, absolute temporary files | [
"Get",
"changed",
"files",
"table",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L594-L600 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/ChunkMapReader.java | ChunkMapReader.getConflicTable | public Map<URI, URI> getConflicTable() {
for (final Map.Entry<URI, URI> e : conflictTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
return conflictTable;
} | java | public Map<URI, URI> getConflicTable() {
for (final Map.Entry<URI, URI> e : conflictTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
return conflictTable;
} | [
"public",
"Map",
"<",
"URI",
",",
"URI",
">",
"getConflicTable",
"(",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"URI",
",",
"URI",
">",
"e",
":",
"conflictTable",
".",
"entrySet",
"(",
")",
")",
"{",
"assert",
"e",
".",
"getKey",
"... | get conflict table.
@return conflict table, absolute temporary files | [
"get",
"conflict",
"table",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/ChunkMapReader.java#L607-L613 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/ImportAntAction.java | ImportAntAction.getResult | @Override
public void getResult(final ContentHandler buf) throws SAXException {
for (final Value value: valueSet) {
final String[] tokens = value.value.split("[/\\\\]", 2);
buf.startElement(NULL_NS_URI, "import", "import", XMLUtils.EMPTY_ATTRIBUTES);
buf.startElement(NULL... | java | @Override
public void getResult(final ContentHandler buf) throws SAXException {
for (final Value value: valueSet) {
final String[] tokens = value.value.split("[/\\\\]", 2);
buf.startElement(NULL_NS_URI, "import", "import", XMLUtils.EMPTY_ATTRIBUTES);
buf.startElement(NULL... | [
"@",
"Override",
"public",
"void",
"getResult",
"(",
"final",
"ContentHandler",
"buf",
")",
"throws",
"SAXException",
"{",
"for",
"(",
"final",
"Value",
"value",
":",
"valueSet",
")",
"{",
"final",
"String",
"[",
"]",
"tokens",
"=",
"value",
".",
"value",
... | Generate Ant import task. | [
"Generate",
"Ant",
"import",
"task",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/ImportAntAction.java#L28-L40 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/pipeline/PipelineHashIO.java | PipelineHashIO.setAttribute | @Override
public void setAttribute(final String name, final String value) {
hash.put(name, value);
} | java | @Override
public void setAttribute(final String name, final String value) {
hash.put(name, value);
} | [
"@",
"Override",
"public",
"void",
"setAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"hash",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set the attribute vale with name into hash map.
@param name name
@param value value | [
"Set",
"the",
"attribute",
"vale",
"with",
"name",
"into",
"hash",
"map",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/pipeline/PipelineHashIO.java#L42-L45 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/pipeline/PipelineHashIO.java | PipelineHashIO.getAttribute | @Override
public String getAttribute(final String name) {
String value;
value = hash.get(name);
return value;
} | java | @Override
public String getAttribute(final String name) {
String value;
value = hash.get(name);
return value;
} | [
"@",
"Override",
"public",
"String",
"getAttribute",
"(",
"final",
"String",
"name",
")",
"{",
"String",
"value",
";",
"value",
"=",
"hash",
".",
"get",
"(",
"name",
")",
";",
"return",
"value",
";",
"}"
] | Get the attribute value according to its name.
@param name name
@return String value | [
"Get",
"the",
"attribute",
"value",
"according",
"to",
"its",
"name",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/pipeline/PipelineHashIO.java#L53-L58 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.