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/module/KeyrefModule.java | KeyrefModule.walkMap | void walkMap(final Element elem, final KeyScope scope, final List<ResolveTask> res) {
List<KeyScope> ss = Collections.singletonList(scope);
if (elem.getAttributeNode(ATTRIBUTE_NAME_KEYSCOPE) != null) {
ss = new ArrayList<>();
for (final String keyscope: elem.getAttribute(ATTRIBUT... | java | void walkMap(final Element elem, final KeyScope scope, final List<ResolveTask> res) {
List<KeyScope> ss = Collections.singletonList(scope);
if (elem.getAttributeNode(ATTRIBUTE_NAME_KEYSCOPE) != null) {
ss = new ArrayList<>();
for (final String keyscope: elem.getAttribute(ATTRIBUT... | [
"void",
"walkMap",
"(",
"final",
"Element",
"elem",
",",
"final",
"KeyScope",
"scope",
",",
"final",
"List",
"<",
"ResolveTask",
">",
"res",
")",
"{",
"List",
"<",
"KeyScope",
">",
"ss",
"=",
"Collections",
".",
"singletonList",
"(",
"scope",
")",
";",
... | Recursively walk map and process topics that have keyrefs. | [
"Recursively",
"walk",
"map",
"and",
"process",
"topics",
"that",
"have",
"keyrefs",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/KeyrefModule.java#L249-L295 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/KeyrefModule.java | KeyrefModule.processTopic | private ResolveTask processTopic(final FileInfo f, final KeyScope scope, final boolean isResourceOnly) {
final int increment = isResourceOnly ? 0 : 1;
final Integer used = usage.containsKey(f.uri) ? usage.get(f.uri) + increment : increment;
usage.put(f.uri, used);
if (used > 1) {
... | java | private ResolveTask processTopic(final FileInfo f, final KeyScope scope, final boolean isResourceOnly) {
final int increment = isResourceOnly ? 0 : 1;
final Integer used = usage.containsKey(f.uri) ? usage.get(f.uri) + increment : increment;
usage.put(f.uri, used);
if (used > 1) {
... | [
"private",
"ResolveTask",
"processTopic",
"(",
"final",
"FileInfo",
"f",
",",
"final",
"KeyScope",
"scope",
",",
"final",
"boolean",
"isResourceOnly",
")",
"{",
"final",
"int",
"increment",
"=",
"isResourceOnly",
"?",
"0",
":",
"1",
";",
"final",
"Integer",
... | Determine how topic is processed for key reference processing.
@return key reference processing | [
"Determine",
"how",
"topic",
"is",
"processed",
"for",
"key",
"reference",
"processing",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/KeyrefModule.java#L316-L334 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/KeyrefModule.java | KeyrefModule.processFile | private void processFile(final ResolveTask r) {
final List<XMLFilter> filters = new ArrayList<>();
final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter();
conkeyrefFilter.setLogger(logger);
conkeyrefFilter.setJob(job);
conkeyrefFilter.setKeyDefinitions(r.scope);
c... | java | private void processFile(final ResolveTask r) {
final List<XMLFilter> filters = new ArrayList<>();
final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter();
conkeyrefFilter.setLogger(logger);
conkeyrefFilter.setJob(job);
conkeyrefFilter.setKeyDefinitions(r.scope);
c... | [
"private",
"void",
"processFile",
"(",
"final",
"ResolveTask",
"r",
")",
"{",
"final",
"List",
"<",
"XMLFilter",
">",
"filters",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"ConkeyrefFilter",
"conkeyrefFilter",
"=",
"new",
"ConkeyrefFilter",
"(",
... | Process key references in a topic. Topic is stored with a new name if it's
been processed before. | [
"Process",
"key",
"references",
"in",
"a",
"topic",
".",
"Topic",
"is",
"stored",
"with",
"a",
"new",
"name",
"if",
"it",
"s",
"been",
"processed",
"before",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/KeyrefModule.java#L340-L377 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/KeyrefModule.java | KeyrefModule.writeKeyDefinition | private void writeKeyDefinition(final Map<String, KeyDef> keydefs) {
try {
KeyDef.writeKeydef(new File(job.tempDir, KEYDEF_LIST_FILE), keydefs.values());
} catch (final DITAOTException e) {
logger.error("Failed to write key definition file: " + e.getMessage(), e);
}
} | java | private void writeKeyDefinition(final Map<String, KeyDef> keydefs) {
try {
KeyDef.writeKeydef(new File(job.tempDir, KEYDEF_LIST_FILE), keydefs.values());
} catch (final DITAOTException e) {
logger.error("Failed to write key definition file: " + e.getMessage(), e);
}
} | [
"private",
"void",
"writeKeyDefinition",
"(",
"final",
"Map",
"<",
"String",
",",
"KeyDef",
">",
"keydefs",
")",
"{",
"try",
"{",
"KeyDef",
".",
"writeKeydef",
"(",
"new",
"File",
"(",
"job",
".",
"tempDir",
",",
"KEYDEF_LIST_FILE",
")",
",",
"keydefs",
... | Add key definition to job configuration
@param keydefs key defintions to add | [
"Add",
"key",
"definition",
"to",
"job",
"configuration"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/KeyrefModule.java#L384-L390 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/ArgumentParser.java | ArgumentParser.getPluginArguments | public synchronized Map<String, Argument> getPluginArguments() {
if (PLUGIN_ARGUMENTS == null) {
final List<Element> params = toList(Plugins.getPluginConfiguration().getElementsByTagName("param"));
PLUGIN_ARGUMENTS = params.stream()
.map(ArgumentParser::getArgument)
... | java | public synchronized Map<String, Argument> getPluginArguments() {
if (PLUGIN_ARGUMENTS == null) {
final List<Element> params = toList(Plugins.getPluginConfiguration().getElementsByTagName("param"));
PLUGIN_ARGUMENTS = params.stream()
.map(ArgumentParser::getArgument)
... | [
"public",
"synchronized",
"Map",
"<",
"String",
",",
"Argument",
">",
"getPluginArguments",
"(",
")",
"{",
"if",
"(",
"PLUGIN_ARGUMENTS",
"==",
"null",
")",
"{",
"final",
"List",
"<",
"Element",
">",
"params",
"=",
"toList",
"(",
"Plugins",
".",
"getPlugin... | Lazy load parameters | [
"Lazy",
"load",
"parameters"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/ArgumentParser.java#L84-L95 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/ArgumentParser.java | ArgumentParser.handleArgDefine | private Map<String, Object> handleArgDefine(final String arg, final Deque<String> args) {
/*
* Interestingly enough, we get to here when a user uses -Dname=value.
* However, in some cases, the OS goes ahead and parses this out to args
* {"-Dname", "value"} so instead of parsing on "="... | java | private Map<String, Object> handleArgDefine(final String arg, final Deque<String> args) {
/*
* Interestingly enough, we get to here when a user uses -Dname=value.
* However, in some cases, the OS goes ahead and parses this out to args
* {"-Dname", "value"} so instead of parsing on "="... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"handleArgDefine",
"(",
"final",
"String",
"arg",
",",
"final",
"Deque",
"<",
"String",
">",
"args",
")",
"{",
"/*\n * Interestingly enough, we get to here when a user uses -Dname=value.\n * However, in so... | Handler -D argument | [
"Handler",
"-",
"D",
"argument"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/ArgumentParser.java#L451-L470 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/ArgumentParser.java | ArgumentParser.handleArgInput | private void handleArgInput(final String arg, final Deque<String> args, final Argument argument) {
final Map.Entry<String, String> entry = parse(arg, args);
if (entry.getValue() == null) {
throw new BuildException("Missing value for input " + entry.getKey());
}
inputs.add(arg... | java | private void handleArgInput(final String arg, final Deque<String> args, final Argument argument) {
final Map.Entry<String, String> entry = parse(arg, args);
if (entry.getValue() == null) {
throw new BuildException("Missing value for input " + entry.getKey());
}
inputs.add(arg... | [
"private",
"void",
"handleArgInput",
"(",
"final",
"String",
"arg",
",",
"final",
"Deque",
"<",
"String",
">",
"args",
",",
"final",
"Argument",
"argument",
")",
"{",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
"=",
"parse",... | Handler input argument | [
"Handler",
"input",
"argument"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/ArgumentParser.java#L488-L494 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/ArgumentParser.java | ArgumentParser.handleParameterArg | private Map<String, Object> handleParameterArg(final String arg, final Deque<String> args, final Argument argument) {
final Map.Entry<String, String> entry = parse(arg, args);
if (entry.getValue() == null) {
throw new BuildException("Missing value for property " + entry.getKey());
}
... | java | private Map<String, Object> handleParameterArg(final String arg, final Deque<String> args, final Argument argument) {
final Map.Entry<String, String> entry = parse(arg, args);
if (entry.getValue() == null) {
throw new BuildException("Missing value for property " + entry.getKey());
}
... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"handleParameterArg",
"(",
"final",
"String",
"arg",
",",
"final",
"Deque",
"<",
"String",
">",
"args",
",",
"final",
"Argument",
"argument",
")",
"{",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",... | Handler parameter argument | [
"Handler",
"parameter",
"argument"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/ArgumentParser.java#L499-L505 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/ArgumentParser.java | ArgumentParser.getArgumentName | private String getArgumentName(final String arg) {
int pos = arg.indexOf("=");
if (pos == -1) {
pos = arg.indexOf(":");
}
return arg.substring(0, pos != -1 ? pos : arg.length());
} | java | private String getArgumentName(final String arg) {
int pos = arg.indexOf("=");
if (pos == -1) {
pos = arg.indexOf(":");
}
return arg.substring(0, pos != -1 ? pos : arg.length());
} | [
"private",
"String",
"getArgumentName",
"(",
"final",
"String",
"arg",
")",
"{",
"int",
"pos",
"=",
"arg",
".",
"indexOf",
"(",
"\"=\"",
")",
";",
"if",
"(",
"pos",
"==",
"-",
"1",
")",
"{",
"pos",
"=",
"arg",
".",
"indexOf",
"(",
"\":\"",
")",
"... | Get argument name | [
"Get",
"argument",
"name"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/ArgumentParser.java#L510-L516 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ExportAnchorsFilter.java | ExportAnchorsFilter.setCurrentFile | public void setCurrentFile(final URI currentFile) {
assert currentFile.isAbsolute();
super.setCurrentFile(currentFile);
currentDir = currentFile.resolve(".");
} | java | public void setCurrentFile(final URI currentFile) {
assert currentFile.isAbsolute();
super.setCurrentFile(currentFile);
currentDir = currentFile.resolve(".");
} | [
"public",
"void",
"setCurrentFile",
"(",
"final",
"URI",
"currentFile",
")",
"{",
"assert",
"currentFile",
".",
"isAbsolute",
"(",
")",
";",
"super",
".",
"setCurrentFile",
"(",
"currentFile",
")",
";",
"currentDir",
"=",
"currentFile",
".",
"resolve",
"(",
... | Set current file absolute path
@param currentFile absolute path to current file | [
"Set",
"current",
"file",
"absolute",
"path"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ExportAnchorsFilter.java#L68-L72 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ExportAnchorsFilter.java | ExportAnchorsFilter.parseAttribute | private void parseAttribute(final Attributes atts) {
final URI attrValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
if (attrValue == null) {
return;
}
final String attrScope = atts.getValue(ATTRIBUTE_NAME_SCOPE);
if (isExternal(attrValue, attrScope)) {
... | java | private void parseAttribute(final Attributes atts) {
final URI attrValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
if (attrValue == null) {
return;
}
final String attrScope = atts.getValue(ATTRIBUTE_NAME_SCOPE);
if (isExternal(attrValue, attrScope)) {
... | [
"private",
"void",
"parseAttribute",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"URI",
"attrValue",
"=",
"toURI",
"(",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_HREF",
")",
")",
";",
"if",
"(",
"attrValue",
"==",
"null",
")",
"{",
"return",... | Parse the href attribute for needed information.
@param atts attributes to process | [
"Parse",
"the",
"href",
"attribute",
"for",
"needed",
"information",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ExportAnchorsFilter.java#L164-L191 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.processParseResult | private void processParseResult(final URI currentFile) {
// Category non-copyto result and update uplevels accordingly
for (final Reference file: listFilter.getNonCopytoResult()) {
categorizeReferenceFile(file);
updateUplevels(file.filename);
}
for (final Map.Entr... | java | private void processParseResult(final URI currentFile) {
// Category non-copyto result and update uplevels accordingly
for (final Reference file: listFilter.getNonCopytoResult()) {
categorizeReferenceFile(file);
updateUplevels(file.filename);
}
for (final Map.Entr... | [
"private",
"void",
"processParseResult",
"(",
"final",
"URI",
"currentFile",
")",
"{",
"// Category non-copyto result and update uplevels accordingly",
"for",
"(",
"final",
"Reference",
"file",
":",
"listFilter",
".",
"getNonCopytoResult",
"(",
")",
")",
"{",
"categoriz... | Process results from parsing a single topic or map
@param currentFile absolute URI processes files | [
"Process",
"results",
"from",
"parsing",
"a",
"single",
"topic",
"or",
"map"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L459-L509 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.categorizeReferenceFile | private void categorizeReferenceFile(final Reference file) {
// avoid files referred by coderef being added into wait list
if (listFilter.getCoderefTargets().contains(file.filename)) {
return;
}
if (isFormatDita(file.format) && listFilter.isDitaTopic() &&
!job... | java | private void categorizeReferenceFile(final Reference file) {
// avoid files referred by coderef being added into wait list
if (listFilter.getCoderefTargets().contains(file.filename)) {
return;
}
if (isFormatDita(file.format) && listFilter.isDitaTopic() &&
!job... | [
"private",
"void",
"categorizeReferenceFile",
"(",
"final",
"Reference",
"file",
")",
"{",
"// avoid files referred by coderef being added into wait list",
"if",
"(",
"listFilter",
".",
"getCoderefTargets",
"(",
")",
".",
"contains",
"(",
"file",
".",
"filename",
")",
... | Categorize file.
@param file file system path with optional format | [
"Categorize",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L556-L577 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.getLevelsPath | private String getLevelsPath(final URI rootTemp) {
final int u = rootTemp.toString().split(URI_SEPARATOR).length - 1;
if (u == 0) {
return "";
}
final StringBuilder buff = new StringBuilder();
for (int current = u; current > 0; current--) {
buff.append("..... | java | private String getLevelsPath(final URI rootTemp) {
final int u = rootTemp.toString().split(URI_SEPARATOR).length - 1;
if (u == 0) {
return "";
}
final StringBuilder buff = new StringBuilder();
for (int current = u; current > 0; current--) {
buff.append("..... | [
"private",
"String",
"getLevelsPath",
"(",
"final",
"URI",
"rootTemp",
")",
"{",
"final",
"int",
"u",
"=",
"rootTemp",
".",
"toString",
"(",
")",
".",
"split",
"(",
"URI_SEPARATOR",
")",
".",
"length",
"-",
"1",
";",
"if",
"(",
"u",
"==",
"0",
")",
... | Get up-levels absolute path.
@param rootTemp relative URI for temporary root file
@return path to up-level, e.g. {@code ../../}, may be empty string | [
"Get",
"up",
"-",
"levels",
"absolute",
"path",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L630-L640 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.filterConflictingCopyTo | private Map<URI, URI> filterConflictingCopyTo( final Map<URI, URI> copyTo, final Collection<FileInfo> fileInfos) {
final Set<URI> fileinfoTargets = fileInfos.stream()
.filter(fi -> fi.src.equals(fi.result))
.map(fi -> fi.result)
.collect(Collectors.toSet());
... | java | private Map<URI, URI> filterConflictingCopyTo( final Map<URI, URI> copyTo, final Collection<FileInfo> fileInfos) {
final Set<URI> fileinfoTargets = fileInfos.stream()
.filter(fi -> fi.src.equals(fi.result))
.map(fi -> fi.result)
.collect(Collectors.toSet());
... | [
"private",
"Map",
"<",
"URI",
",",
"URI",
">",
"filterConflictingCopyTo",
"(",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"copyTo",
",",
"final",
"Collection",
"<",
"FileInfo",
">",
"fileInfos",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"fileinfoTarge... | Filter copy-to where target is used directly. | [
"Filter",
"copy",
"-",
"to",
"where",
"target",
"is",
"used",
"directly",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L849-L857 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.writeListFile | private void writeListFile(final File inputfile, final String relativeRootFile) {
try (Writer bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)))) {
bufferedWriter.write(relativeRootFile);
bufferedWriter.flush();
} catch (final IOException... | java | private void writeListFile(final File inputfile, final String relativeRootFile) {
try (Writer bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)))) {
bufferedWriter.write(relativeRootFile);
bufferedWriter.flush();
} catch (final IOException... | [
"private",
"void",
"writeListFile",
"(",
"final",
"File",
"inputfile",
",",
"final",
"String",
"relativeRootFile",
")",
"{",
"try",
"(",
"Writer",
"bufferedWriter",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"("... | Write list file.
@param inputfile output list file
@param relativeRootFile list value | [
"Write",
"list",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L864-L871 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.getPrefix | private String getPrefix(final File relativeRootFile) {
String res;
final File p = relativeRootFile.getParentFile();
if (p != null) {
res = p.toString() + File.separator;
} else {
res = "";
}
return res;
} | java | private String getPrefix(final File relativeRootFile) {
String res;
final File p = relativeRootFile.getParentFile();
if (p != null) {
res = p.toString() + File.separator;
} else {
res = "";
}
return res;
} | [
"private",
"String",
"getPrefix",
"(",
"final",
"File",
"relativeRootFile",
")",
"{",
"String",
"res",
";",
"final",
"File",
"p",
"=",
"relativeRootFile",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"res",
"=",
"p",
"."... | Prefix path.
@param relativeRootFile relative path for root temporary file
@return either an empty string or a path which ends in {@link java.io.File#separator File.separator} | [
"Prefix",
"path",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L879-L888 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.addMapFilePrefix | private Map<URI, Set<URI>> addMapFilePrefix(final Map<URI, Set<URI>> map) {
final Map<URI, Set<URI>> res = new HashMap<>();
for (final Map.Entry<URI, Set<URI>> e: map.entrySet()) {
final URI key = e.getKey();
final Set<URI> newSet = new HashSet<>(e.getValue().size());
... | java | private Map<URI, Set<URI>> addMapFilePrefix(final Map<URI, Set<URI>> map) {
final Map<URI, Set<URI>> res = new HashMap<>();
for (final Map.Entry<URI, Set<URI>> e: map.entrySet()) {
final URI key = e.getKey();
final Set<URI> newSet = new HashSet<>(e.getValue().size());
... | [
"private",
"Map",
"<",
"URI",
",",
"Set",
"<",
"URI",
">",
">",
"addMapFilePrefix",
"(",
"final",
"Map",
"<",
"URI",
",",
"Set",
"<",
"URI",
">",
">",
"map",
")",
"{",
"final",
"Map",
"<",
"URI",
",",
"Set",
"<",
"URI",
">",
">",
"res",
"=",
... | Convert absolute paths to relative temporary directory paths
@return map with relative keys and values | [
"Convert",
"absolute",
"paths",
"to",
"relative",
"temporary",
"directory",
"paths"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L909-L920 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.addFilePrefix | private Map<URI, URI> addFilePrefix(final Map<URI, URI> set) {
final Map<URI, URI> newSet = new HashMap<>();
for (final Map.Entry<URI, URI> file: set.entrySet()) {
final URI key = tempFileNameScheme.generateTempFileName(file.getKey());
final URI value = tempFileNameScheme.generat... | java | private Map<URI, URI> addFilePrefix(final Map<URI, URI> set) {
final Map<URI, URI> newSet = new HashMap<>();
for (final Map.Entry<URI, URI> file: set.entrySet()) {
final URI key = tempFileNameScheme.generateTempFileName(file.getKey());
final URI value = tempFileNameScheme.generat... | [
"private",
"Map",
"<",
"URI",
",",
"URI",
">",
"addFilePrefix",
"(",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"set",
")",
"{",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"newSet",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"f... | Add file prefix. For absolute paths the prefix is not added.
@param set file paths
@return file paths with prefix | [
"Add",
"file",
"prefix",
".",
"For",
"absolute",
"paths",
"the",
"prefix",
"is",
"not",
"added",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L928-L936 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java | GenMapAndTopicListModule.addFlagImagesSetToProperties | private void addFlagImagesSetToProperties(final Job prop, final Set<URI> set) {
final Set<URI> newSet = new LinkedHashSet<>(128);
for (final URI file: set) {
// assert file.isAbsolute();
if (file.isAbsolute()) {
// no need to append relative path before absolute pa... | java | private void addFlagImagesSetToProperties(final Job prop, final Set<URI> set) {
final Set<URI> newSet = new LinkedHashSet<>(128);
for (final URI file: set) {
// assert file.isAbsolute();
if (file.isAbsolute()) {
// no need to append relative path before absolute pa... | [
"private",
"void",
"addFlagImagesSetToProperties",
"(",
"final",
"Job",
"prop",
",",
"final",
"Set",
"<",
"URI",
">",
"set",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"newSet",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
"128",
")",
";",
"for",
"(",
"fina... | add FlagImangesSet to Properties, which needn't to change the dir level,
just ouput to the ouput dir.
@param prop job configuration
@param set absolute flag image files | [
"add",
"FlagImangesSet",
"to",
"Properties",
"which",
"needn",
"t",
"to",
"change",
"the",
"dir",
"level",
"just",
"ouput",
"to",
"the",
"ouput",
"dir",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/GenMapAndTopicListModule.java#L954-L986 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/SourceReaderModule.java | SourceReaderModule.getXmlReader | XMLReader getXmlReader(final String format) throws SAXException {
if (format == null || format.equals(ATTR_FORMAT_VALUE_DITA)) {
return reader;
}
for (final Map.Entry<String, String> e : parserMap.entrySet()) {
if (format.equals(e.getKey())) {
try {
... | java | XMLReader getXmlReader(final String format) throws SAXException {
if (format == null || format.equals(ATTR_FORMAT_VALUE_DITA)) {
return reader;
}
for (final Map.Entry<String, String> e : parserMap.entrySet()) {
if (format.equals(e.getKey())) {
try {
... | [
"XMLReader",
"getXmlReader",
"(",
"final",
"String",
"format",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"format",
"==",
"null",
"||",
"format",
".",
"equals",
"(",
"ATTR_FORMAT_VALUE_DITA",
")",
")",
"{",
"return",
"reader",
";",
"}",
"for",
"(",
"fi... | Get reader for input format
@param format input document format
@return reader for given format
@throws SAXException if creating reader failed | [
"Get",
"reader",
"for",
"input",
"format"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/SourceReaderModule.java#L60-L84 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/SourceReaderModule.java | SourceReaderModule.initXmlReader | void initXmlReader() throws SAXException {
if (parserMap.containsKey(ATTR_FORMAT_VALUE_DITA)) {
reader = XMLReaderFactory.createXMLReader(parserMap.get(ATTR_FORMAT_VALUE_DITA));
final Map<String, Boolean> features = parserFeatures.getOrDefault(ATTR_FORMAT_VALUE_DITA, emptyMap());
... | java | void initXmlReader() throws SAXException {
if (parserMap.containsKey(ATTR_FORMAT_VALUE_DITA)) {
reader = XMLReaderFactory.createXMLReader(parserMap.get(ATTR_FORMAT_VALUE_DITA));
final Map<String, Boolean> features = parserFeatures.getOrDefault(ATTR_FORMAT_VALUE_DITA, emptyMap());
... | [
"void",
"initXmlReader",
"(",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"parserMap",
".",
"containsKey",
"(",
"ATTR_FORMAT_VALUE_DITA",
")",
")",
"{",
"reader",
"=",
"XMLReaderFactory",
".",
"createXMLReader",
"(",
"parserMap",
".",
"get",
"(",
"ATTR_FORMAT... | XML reader used for pipeline parsing DITA documents.
@throws SAXException if parser configuration failed | [
"XML",
"reader",
"used",
"for",
"pipeline",
"parsing",
"DITA",
"documents",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/SourceReaderModule.java#L91-L129 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/PluginParser.java | PluginParser.migrate | private Element migrate(Element root) {
if (root.getAttributeNode(PLUGIN_VERSION_ATTR) == null) {
final List<Element> features = toList(root.getElementsByTagName(FEATURE_ELEM));
final String version = features.stream()
.filter(elem -> elem.getAttribute(FEATURE_ID_ATTR... | java | private Element migrate(Element root) {
if (root.getAttributeNode(PLUGIN_VERSION_ATTR) == null) {
final List<Element> features = toList(root.getElementsByTagName(FEATURE_ELEM));
final String version = features.stream()
.filter(elem -> elem.getAttribute(FEATURE_ID_ATTR... | [
"private",
"Element",
"migrate",
"(",
"Element",
"root",
")",
"{",
"if",
"(",
"root",
".",
"getAttributeNode",
"(",
"PLUGIN_VERSION_ATTR",
")",
"==",
"null",
")",
"{",
"final",
"List",
"<",
"Element",
">",
"features",
"=",
"toList",
"(",
"root",
".",
"ge... | Migrate from deprecated plugin format to new format | [
"Migrate",
"from",
"deprecated",
"plugin",
"format",
"to",
"new",
"format"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/PluginParser.java#L128-L139 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/PluginParser.java | PluginParser.addExtensionPoint | private void addExtensionPoint(final Element elem) {
final String id = elem.getAttribute(EXTENSION_POINT_ID_ATTR);
if (id == null) {
throw new IllegalArgumentException(EXTENSION_POINT_ID_ATTR + " attribute not set on extension-point");
}
final String name = elem.getAttribute(... | java | private void addExtensionPoint(final Element elem) {
final String id = elem.getAttribute(EXTENSION_POINT_ID_ATTR);
if (id == null) {
throw new IllegalArgumentException(EXTENSION_POINT_ID_ATTR + " attribute not set on extension-point");
}
final String name = elem.getAttribute(... | [
"private",
"void",
"addExtensionPoint",
"(",
"final",
"Element",
"elem",
")",
"{",
"final",
"String",
"id",
"=",
"elem",
".",
"getAttribute",
"(",
"EXTENSION_POINT_ID_ATTR",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Add extension point.
@param elem extension point element attributes
@throws IllegalArgumentException if extension ID is {@code null} | [
"Add",
"extension",
"point",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/PluginParser.java#L158-L165 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/DitaLinksWriter.java | DitaLinksWriter.domToSax | private void domToSax(final Node root) throws SAXException {
try {
final Result result = new SAXResult(new FilterHandler(getContentHandler()));
final NodeList children = root.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node links = ... | java | private void domToSax(final Node root) throws SAXException {
try {
final Result result = new SAXResult(new FilterHandler(getContentHandler()));
final NodeList children = root.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
final Node links = ... | [
"private",
"void",
"domToSax",
"(",
"final",
"Node",
"root",
")",
"throws",
"SAXException",
"{",
"try",
"{",
"final",
"Result",
"result",
"=",
"new",
"SAXResult",
"(",
"new",
"FilterHandler",
"(",
"getContentHandler",
"(",
")",
")",
")",
";",
"final",
"Nod... | DOM to SAX conversion methods | [
"DOM",
"to",
"SAX",
"conversion",
"methods"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/DitaLinksWriter.java#L161-L173 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java | RelaxNGDefaultsComponent.onStartElement | private void onStartElement(QName name, XMLAttributes atts) {
if (detecting) {
detecting = false;
loadDefaults();
}
if (defaults != null) {
checkAndAddDefaults(name, atts);
}
} | java | private void onStartElement(QName name, XMLAttributes atts) {
if (detecting) {
detecting = false;
loadDefaults();
}
if (defaults != null) {
checkAndAddDefaults(name, atts);
}
} | [
"private",
"void",
"onStartElement",
"(",
"QName",
"name",
",",
"XMLAttributes",
"atts",
")",
"{",
"if",
"(",
"detecting",
")",
"{",
"detecting",
"=",
"false",
";",
"loadDefaults",
"(",
")",
";",
"}",
"if",
"(",
"defaults",
"!=",
"null",
")",
"{",
"che... | On start element
@param name The element name
@param atts The attributes | [
"On",
"start",
"element"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java#L220-L228 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java | RelaxNGDefaultsComponent.nullOrValue | private boolean nullOrValue(String test, String value) {
if (test == null)
return true;
if (test.equals(value))
return true;
return false;
} | java | private boolean nullOrValue(String test, String value) {
if (test == null)
return true;
if (test.equals(value))
return true;
return false;
} | [
"private",
"boolean",
"nullOrValue",
"(",
"String",
"test",
",",
"String",
"value",
")",
"{",
"if",
"(",
"test",
"==",
"null",
")",
"return",
"true",
";",
"if",
"(",
"test",
".",
"equals",
"(",
"value",
")",
")",
"return",
"true",
";",
"return",
"fal... | Test if a string is either null or equal to a certain value
@param test The string to test
@param value The value to compare to
@return <code>true</code> if a string is either null or equal to a certain value | [
"Test",
"if",
"a",
"string",
"is",
"either",
"null",
"or",
"equal",
"to",
"a",
"certain",
"value"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java#L489-L495 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java | RelaxNGDefaultsComponent.getFromPIDataPseudoAttribute | private String getFromPIDataPseudoAttribute(String data, String name,
boolean unescapeValue) {
int pos = 0;
while (pos <= data.length() - 4) { // minimum length of x=""
int nextQuote = -1;
for (int q = pos; q < data.length(); q++) {
if (data.charAt(q) == '"' || data.charAt(q) == '\'') ... | java | private String getFromPIDataPseudoAttribute(String data, String name,
boolean unescapeValue) {
int pos = 0;
while (pos <= data.length() - 4) { // minimum length of x=""
int nextQuote = -1;
for (int q = pos; q < data.length(); q++) {
if (data.charAt(q) == '"' || data.charAt(q) == '\'') ... | [
"private",
"String",
"getFromPIDataPseudoAttribute",
"(",
"String",
"data",
",",
"String",
"name",
",",
"boolean",
"unescapeValue",
")",
"{",
"int",
"pos",
"=",
"0",
";",
"while",
"(",
"pos",
"<=",
"data",
".",
"length",
"(",
")",
"-",
"4",
")",
"{",
"... | This method is copied from com.icl.saxon.ProcInstParser and used in the
PIFinder.
Get a pseudo-attribute. This is useful only if the processing instruction
data part uses pseudo-attribute syntax, which it does not have to. This
syntax is as described in the W3C Recommendation
"Associating Style Sheets with XML Documen... | [
"This",
"method",
"is",
"copied",
"from",
"com",
".",
"icl",
".",
"saxon",
".",
"ProcInstParser",
"and",
"used",
"in",
"the",
"PIFinder",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java#L514-L556 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java | RelaxNGDefaultsComponent.unescape | private String unescape(String value) {
if (value.indexOf('&') < 0) {
return value;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
if (c == '&') {
if (i + 2 < value.length() && value.charAt(i + 1) == '#') {
... | java | private String unescape(String value) {
if (value.indexOf('&') < 0) {
return value;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
if (c == '&') {
if (i + 2 < value.length() && value.charAt(i + 1) == '#') {
... | [
"private",
"String",
"unescape",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
".",
"indexOf",
"(",
"'",
"'",
")",
"<",
"0",
")",
"{",
"return",
"value",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(... | This method is copied from com.icl.saxon.ProcInstParser and used in the
PIFinder
Interpret character references and built-in entity references | [
"This",
"method",
"is",
"copied",
"from",
"com",
".",
"icl",
".",
"saxon",
".",
"ProcInstParser",
"and",
"used",
"in",
"the",
"PIFinder"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java#L564-L629 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java | RelaxNGDefaultsComponent.setProperty | public void setProperty(String propertyId, Object value)
throws XMLConfigurationException {
// Xerces properties
if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
final int suffixLength = propertyId.length()
- Constants.XERCES_PROPERTY_PREFIX.length();
if (suffixLength... | java | public void setProperty(String propertyId, Object value)
throws XMLConfigurationException {
// Xerces properties
if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
final int suffixLength = propertyId.length()
- Constants.XERCES_PROPERTY_PREFIX.length();
if (suffixLength... | [
"public",
"void",
"setProperty",
"(",
"String",
"propertyId",
",",
"Object",
"value",
")",
"throws",
"XMLConfigurationException",
"{",
"// Xerces properties",
"if",
"(",
"propertyId",
".",
"startsWith",
"(",
"Constants",
".",
"XERCES_PROPERTY_PREFIX",
")",
")",
"{",... | Sets the value of a property during parsing. | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"during",
"parsing",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultsComponent.java#L786-L802 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.write | @Override
public void write(final File filename) throws DITAOTException {
assert filename.isAbsolute();
super.write(new File(currentFile));
} | java | @Override
public void write(final File filename) throws DITAOTException {
assert filename.isAbsolute();
super.write(new File(currentFile));
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"final",
"File",
"filename",
")",
"throws",
"DITAOTException",
"{",
"assert",
"filename",
".",
"isAbsolute",
"(",
")",
";",
"super",
".",
"write",
"(",
"new",
"File",
"(",
"currentFile",
")",
")",
";",
"}"... | Process key references.
@param filename file to process
@throws DITAOTException if key reference resolution failed | [
"Process",
"key",
"references",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L211-L215 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.writeAlt | private void writeAlt(Element srcElem) throws SAXException {
final AttributesImpl atts = new AttributesImpl();
XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_CLASS, TOPIC_ALT.toString());
getContentHandler().startElement(NULL_NS_URI, TOPIC_ALT.localName, TOPIC_ALT.localName, atts);
domT... | java | private void writeAlt(Element srcElem) throws SAXException {
final AttributesImpl atts = new AttributesImpl();
XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_CLASS, TOPIC_ALT.toString());
getContentHandler().startElement(NULL_NS_URI, TOPIC_ALT.localName, TOPIC_ALT.localName, atts);
domT... | [
"private",
"void",
"writeAlt",
"(",
"Element",
"srcElem",
")",
"throws",
"SAXException",
"{",
"final",
"AttributesImpl",
"atts",
"=",
"new",
"AttributesImpl",
"(",
")",
";",
"XMLUtils",
".",
"addOrSetAttribute",
"(",
"atts",
",",
"ATTRIBUTE_NAME_CLASS",
",",
"TO... | Write alt element
@param srcElem element content | [
"Write",
"alt",
"element"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L428-L434 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.fallbackToNavtitleOrHref | private boolean fallbackToNavtitleOrHref(final Element elem) {
final String hrefValue = elem.getAttribute(ATTRIBUTE_NAME_HREF);
final String locktitleValue = elem.getAttribute(ATTRIBUTE_NAME_LOCKTITLE);
return ((ATTRIBUTE_NAME_LOCKTITLE_VALUE_YES.equals(locktitleValue)) ||
("".eq... | java | private boolean fallbackToNavtitleOrHref(final Element elem) {
final String hrefValue = elem.getAttribute(ATTRIBUTE_NAME_HREF);
final String locktitleValue = elem.getAttribute(ATTRIBUTE_NAME_LOCKTITLE);
return ((ATTRIBUTE_NAME_LOCKTITLE_VALUE_YES.equals(locktitleValue)) ||
("".eq... | [
"private",
"boolean",
"fallbackToNavtitleOrHref",
"(",
"final",
"Element",
"elem",
")",
"{",
"final",
"String",
"hrefValue",
"=",
"elem",
".",
"getAttribute",
"(",
"ATTRIBUTE_NAME_HREF",
")",
";",
"final",
"String",
"locktitleValue",
"=",
"elem",
".",
"getAttribut... | Return true when keyref text resolution should use navtitle as a final fallback.
@param elem Key definition element | [
"Return",
"true",
"when",
"keyref",
"text",
"resolution",
"should",
"use",
"navtitle",
"as",
"a",
"final",
"fallback",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L656-L662 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.domToSax | private void domToSax(final Element elem, final boolean retainElements, final boolean swapMapClass) throws SAXException {
if (retainElements) {
final AttributesImpl atts = new AttributesImpl();
final NamedNodeMap attrs = elem.getAttributes();
for (int i = 0; i < attrs.getLeng... | java | private void domToSax(final Element elem, final boolean retainElements, final boolean swapMapClass) throws SAXException {
if (retainElements) {
final AttributesImpl atts = new AttributesImpl();
final NamedNodeMap attrs = elem.getAttributes();
for (int i = 0; i < attrs.getLeng... | [
"private",
"void",
"domToSax",
"(",
"final",
"Element",
"elem",
",",
"final",
"boolean",
"retainElements",
",",
"final",
"boolean",
"swapMapClass",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"retainElements",
")",
"{",
"final",
"AttributesImpl",
"atts",
"=",... | Serialize DOM node into a SAX stream.
@param elem element to serialize
@param retainElements {@code true} to serialize elements, {@code false} to only serialize text nodes.
@param swapMapClass {@code true} to change map/ to topic/ in common class attributes, {@code false} to leave as is | [
"Serialize",
"DOM",
"node",
"into",
"a",
"SAX",
"stream",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L681-L714 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.changeclassValue | private String changeclassValue(final String classValue) {
final DitaClass cls = new DitaClass(classValue);
if (cls.equals(MAP_LINKTEXT)) {
return TOPIC_LINKTEXT.toString();
} else if (cls.equals(MAP_SEARCHTITLE)) {
return TOPIC_SEARCHTITLE.toString();
} else if (... | java | private String changeclassValue(final String classValue) {
final DitaClass cls = new DitaClass(classValue);
if (cls.equals(MAP_LINKTEXT)) {
return TOPIC_LINKTEXT.toString();
} else if (cls.equals(MAP_SEARCHTITLE)) {
return TOPIC_SEARCHTITLE.toString();
} else if (... | [
"private",
"String",
"changeclassValue",
"(",
"final",
"String",
"classValue",
")",
"{",
"final",
"DitaClass",
"cls",
"=",
"new",
"DitaClass",
"(",
"classValue",
")",
";",
"if",
"(",
"cls",
".",
"equals",
"(",
"MAP_LINKTEXT",
")",
")",
"{",
"return",
"TOPI... | Change map type to topic type. | [
"Change",
"map",
"type",
"to",
"topic",
"type",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L719-L730 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.normalizeHrefValue | private static URI normalizeHrefValue(final URI keyName, final String tail) {
if (keyName.getFragment() == null) {
return toURI(keyName + tail.replaceAll(SLASH, SHARP));
}
return toURI(keyName + tail);
} | java | private static URI normalizeHrefValue(final URI keyName, final String tail) {
if (keyName.getFragment() == null) {
return toURI(keyName + tail.replaceAll(SLASH, SHARP));
}
return toURI(keyName + tail);
} | [
"private",
"static",
"URI",
"normalizeHrefValue",
"(",
"final",
"URI",
"keyName",
",",
"final",
"String",
"tail",
")",
"{",
"if",
"(",
"keyName",
".",
"getFragment",
"(",
")",
"==",
"null",
")",
"{",
"return",
"toURI",
"(",
"keyName",
"+",
"tail",
".",
... | change elementId into topicId if there is no topicId in key definition. | [
"change",
"elementId",
"into",
"topicId",
"if",
"there",
"is",
"no",
"topicId",
"in",
"key",
"definition",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L735-L740 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/KeyrefPaser.java | KeyrefPaser.normalizeHrefValue | private static URI normalizeHrefValue(final URI fileName, final String tail, final String topicId) {
//Insert first topic id only when topicid is not set in keydef
//and keyref has elementid
if (fileName.getFragment() == null && !"".equals(tail)) {
return setFragment(fileName, topicI... | java | private static URI normalizeHrefValue(final URI fileName, final String tail, final String topicId) {
//Insert first topic id only when topicid is not set in keydef
//and keyref has elementid
if (fileName.getFragment() == null && !"".equals(tail)) {
return setFragment(fileName, topicI... | [
"private",
"static",
"URI",
"normalizeHrefValue",
"(",
"final",
"URI",
"fileName",
",",
"final",
"String",
"tail",
",",
"final",
"String",
"topicId",
")",
"{",
"//Insert first topic id only when topicid is not set in keydef",
"//and keyref has elementid",
"if",
"(",
"file... | Insert topic id into href | [
"Insert",
"topic",
"id",
"into",
"href"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/KeyrefPaser.java#L752-L759 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/CoderefResolver.java | CoderefResolver.getRange | private Range getRange(final URI uri) {
int start = 0;
int end = Integer.MAX_VALUE;
String startId = null;
String endId = null;
final String fragment = uri.getFragment();
if (fragment != null) {
// RFC 5147
final Matcher m = Pattern.compile("^line... | java | private Range getRange(final URI uri) {
int start = 0;
int end = Integer.MAX_VALUE;
String startId = null;
String endId = null;
final String fragment = uri.getFragment();
if (fragment != null) {
// RFC 5147
final Matcher m = Pattern.compile("^line... | [
"private",
"Range",
"getRange",
"(",
"final",
"URI",
"uri",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"String",
"startId",
"=",
"null",
";",
"String",
"endId",
"=",
"null",
";",
"final",
"String",
"... | Factory method for Range implementation | [
"Factory",
"method",
"for",
"Range",
"implementation"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/CoderefResolver.java#L150-L197 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/CoderefResolver.java | CoderefResolver.getCharset | private Charset getCharset(final String value) {
Charset c = null;
if (value != null) {
final String[] tokens = value.trim().split("[;=]");
if (tokens.length >= 3 && tokens[1].trim().equals("charset")) {
try {
c = Charset.forName(tokens[2].trim... | java | private Charset getCharset(final String value) {
Charset c = null;
if (value != null) {
final String[] tokens = value.trim().split("[;=]");
if (tokens.length >= 3 && tokens[1].trim().equals("charset")) {
try {
c = Charset.forName(tokens[2].trim... | [
"private",
"Charset",
"getCharset",
"(",
"final",
"String",
"value",
")",
"{",
"Charset",
"c",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"final",
"String",
"[",
"]",
"tokens",
"=",
"value",
".",
"trim",
"(",
")",
".",
"split",
"... | Get code file charset.
@param value format attribute value, may be {@code null}
@return charset if set, otherwise default charset | [
"Get",
"code",
"file",
"charset",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/CoderefResolver.java#L311-L332 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FilterUtils.java | FilterUtils.needExclude | public boolean needExclude(final Attributes atts, final QName[][] extProps) {
if (filterMap.isEmpty()) {
return false;
}
for (final QName attr: filterAttributes) {
final String value = atts.getValue(attr.getNamespaceURI(), attr.getLocalPart());
if (value != n... | java | public boolean needExclude(final Attributes atts, final QName[][] extProps) {
if (filterMap.isEmpty()) {
return false;
}
for (final QName attr: filterAttributes) {
final String value = atts.getValue(attr.getNamespaceURI(), attr.getLocalPart());
if (value != n... | [
"public",
"boolean",
"needExclude",
"(",
"final",
"Attributes",
"atts",
",",
"final",
"QName",
"[",
"]",
"[",
"]",
"extProps",
")",
"{",
"if",
"(",
"filterMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"final",
"QN... | Check if the given Attributes need to be excluded.
@param atts attributes
@param extProps {@code props} attribute specializations
@return {@code true} if any profiling attribute was excluded, otherwise {@code false} | [
"Check",
"if",
"the",
"given",
"Attributes",
"need",
"to",
"be",
"excluded",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FilterUtils.java#L289-L327 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FilterUtils.java | FilterUtils.getLabelValue | private String getLabelValue(final QName propName, final String attrPropsValue) {
if (attrPropsValue != null) {
int propStart = -1;
if (attrPropsValue.startsWith(propName + "(") || attrPropsValue.contains(" " + propName + "(")) {
propStart = attrPropsValue.indexOf(propNam... | java | private String getLabelValue(final QName propName, final String attrPropsValue) {
if (attrPropsValue != null) {
int propStart = -1;
if (attrPropsValue.startsWith(propName + "(") || attrPropsValue.contains(" " + propName + "(")) {
propStart = attrPropsValue.indexOf(propNam... | [
"private",
"String",
"getLabelValue",
"(",
"final",
"QName",
"propName",
",",
"final",
"String",
"attrPropsValue",
")",
"{",
"if",
"(",
"attrPropsValue",
"!=",
"null",
")",
"{",
"int",
"propStart",
"=",
"-",
"1",
";",
"if",
"(",
"attrPropsValue",
".",
"sta... | Get labelled props value.
@param propName attribute name
@param attrPropsValue attribute value
@return props value, {@code null} if not available | [
"Get",
"labelled",
"props",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FilterUtils.java#L373-L388 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FilterUtils.java | FilterUtils.checkRuleMapping | private void checkRuleMapping(final QName attName, final List<String> attValue) {
if (attValue == null || attValue.isEmpty()) {
return;
}
for (final String attSubValue: attValue) {
final FilterKey filterKey = new FilterKey(attName, attSubValue);
final Action f... | java | private void checkRuleMapping(final QName attName, final List<String> attValue) {
if (attValue == null || attValue.isEmpty()) {
return;
}
for (final String attSubValue: attValue) {
final FilterKey filterKey = new FilterKey(attName, attSubValue);
final Action f... | [
"private",
"void",
"checkRuleMapping",
"(",
"final",
"QName",
"attName",
",",
"final",
"List",
"<",
"String",
">",
"attValue",
")",
"{",
"if",
"(",
"attValue",
"==",
"null",
"||",
"attValue",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for... | Check if attribute value has mapping in filter configuration and throw messages.
@param attName attribute name
@param attValue attribute value | [
"Check",
"if",
"attribute",
"value",
"has",
"mapping",
"in",
"filter",
"configuration",
"and",
"throw",
"messages",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FilterUtils.java#L467-L480 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FilterUtils.java | FilterUtils.refine | private FilterUtils refine(final Map<QName, Map<String, Set<Element>>> bindingMap) {
if (bindingMap != null && !bindingMap.isEmpty()) {
final Map<FilterKey, Action> buf = new HashMap<>(filterMap);
for (final Map.Entry<FilterKey, Action> e: filterMap.entrySet()) {
refineAc... | java | private FilterUtils refine(final Map<QName, Map<String, Set<Element>>> bindingMap) {
if (bindingMap != null && !bindingMap.isEmpty()) {
final Map<FilterKey, Action> buf = new HashMap<>(filterMap);
for (final Map.Entry<FilterKey, Action> e: filterMap.entrySet()) {
refineAc... | [
"private",
"FilterUtils",
"refine",
"(",
"final",
"Map",
"<",
"QName",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"Element",
">",
">",
">",
"bindingMap",
")",
"{",
"if",
"(",
"bindingMap",
"!=",
"null",
"&&",
"!",
"bindingMap",
".",
"isEmpty",
"(",
... | Refine filter with subject scheme.
@param bindingMap subject scheme bindings, {@code Map<AttName, Map<ElemName, Set<Element>>>}
@return new filter with subject scheme information | [
"Refine",
"filter",
"with",
"subject",
"scheme",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FilterUtils.java#L569-L582 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/CopyToReader.java | CopyToReader.isFormatDita | public static boolean isFormatDita(final String attrFormat) {
if (attrFormat == null || attrFormat.equals(ATTR_FORMAT_VALUE_DITA)) {
return true;
}
for (final String f : ditaFormat) {
if (f.equals(attrFormat)) {
return true;
}
}
... | java | public static boolean isFormatDita(final String attrFormat) {
if (attrFormat == null || attrFormat.equals(ATTR_FORMAT_VALUE_DITA)) {
return true;
}
for (final String f : ditaFormat) {
if (f.equals(attrFormat)) {
return true;
}
}
... | [
"public",
"static",
"boolean",
"isFormatDita",
"(",
"final",
"String",
"attrFormat",
")",
"{",
"if",
"(",
"attrFormat",
"==",
"null",
"||",
"attrFormat",
".",
"equals",
"(",
"ATTR_FORMAT_VALUE_DITA",
")",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"... | Check if format is DITA topic.
@param attrFormat format attribute value, may be {@code null}
@return {@code true} if DITA topic, otherwise {@code false} | [
"Check",
"if",
"format",
"is",
"DITA",
"topic",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/CopyToReader.java#L198-L208 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.buildFinished | @Override
public void buildFinished(final BuildEvent event) {
final Throwable error = event.getException();
final StringBuilder message = new StringBuilder();
if (error == null) {
// message.append(StringUtils.LINE_SEP);
// message.append(getBuildSuccessfulMessage());... | java | @Override
public void buildFinished(final BuildEvent event) {
final Throwable error = event.getException();
final StringBuilder message = new StringBuilder();
if (error == null) {
// message.append(StringUtils.LINE_SEP);
// message.append(getBuildSuccessfulMessage());... | [
"@",
"Override",
"public",
"void",
"buildFinished",
"(",
"final",
"BuildEvent",
"event",
")",
"{",
"final",
"Throwable",
"error",
"=",
"event",
".",
"getException",
"(",
")",
";",
"final",
"StringBuilder",
"message",
"=",
"new",
"StringBuilder",
"(",
")",
";... | Prints whether the build succeeded or failed, any errors the occurred
during the build, and how long the build took.
@param event An event with any relevant extra information. Must not be
<code>null</code>. | [
"Prints",
"whether",
"the",
"build",
"succeeded",
"or",
"failed",
"any",
"errors",
"the",
"occurred",
"during",
"the",
"build",
"and",
"how",
"long",
"the",
"build",
"took",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L180-L205 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.targetStarted | @Override
public void targetStarted(final BuildEvent event) {
if (Project.MSG_INFO <= msgOutputLevel && !event.getTarget().getName().equals("")) {
final String msg = StringUtils.LINE_SEP + event.getTarget().getName() + ":";
printMessage(msg, out, event.getPriority());
log... | java | @Override
public void targetStarted(final BuildEvent event) {
if (Project.MSG_INFO <= msgOutputLevel && !event.getTarget().getName().equals("")) {
final String msg = StringUtils.LINE_SEP + event.getTarget().getName() + ":";
printMessage(msg, out, event.getPriority());
log... | [
"@",
"Override",
"public",
"void",
"targetStarted",
"(",
"final",
"BuildEvent",
"event",
")",
"{",
"if",
"(",
"Project",
".",
"MSG_INFO",
"<=",
"msgOutputLevel",
"&&",
"!",
"event",
".",
"getTarget",
"(",
")",
".",
"getName",
"(",
")",
".",
"equals",
"("... | Logs a message to say that the target has started if this logger allows
information-level messages.
@param event An event with any relevant extra information. Must not be
<code>null</code>. | [
"Logs",
"a",
"message",
"to",
"say",
"that",
"the",
"target",
"has",
"started",
"if",
"this",
"logger",
"allows",
"information",
"-",
"level",
"messages",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L234-L241 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.messageLogged | @Override
public void messageLogged(final BuildEvent event) {
final int priority = event.getPriority();
// Filter out messages based on priority
if (priority <= msgOutputLevel) {
final StringBuilder message = new StringBuilder();
if (event.getTask() != null && !emacs... | java | @Override
public void messageLogged(final BuildEvent event) {
final int priority = event.getPriority();
// Filter out messages based on priority
if (priority <= msgOutputLevel) {
final StringBuilder message = new StringBuilder();
if (event.getTask() != null && !emacs... | [
"@",
"Override",
"public",
"void",
"messageLogged",
"(",
"final",
"BuildEvent",
"event",
")",
"{",
"final",
"int",
"priority",
"=",
"event",
".",
"getPriority",
"(",
")",
";",
"// Filter out messages based on priority",
"if",
"(",
"priority",
"<=",
"msgOutputLevel... | Logs a message, if the priority is suitable. In non-emacs mode, task
level messages are prefixed by the task name which is right-justified.
@param event A BuildEvent containing message information. Must not be
<code>null</code>. | [
"Logs",
"a",
"message",
"if",
"the",
"priority",
"is",
"suitable",
".",
"In",
"non",
"-",
"emacs",
"mode",
"task",
"level",
"messages",
"are",
"prefixed",
"by",
"the",
"task",
"name",
"which",
"is",
"right",
"-",
"justified",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L277-L340 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.printMessage | private void printMessage(final String message, final PrintStream stream, final int priority) {
if (useColor && priority == Project.MSG_ERR) {
stream.print(ANSI_RED);
stream.print(message);
stream.println(ANSI_RESET);
} else {
stream.println(message);
... | java | private void printMessage(final String message, final PrintStream stream, final int priority) {
if (useColor && priority == Project.MSG_ERR) {
stream.print(ANSI_RED);
stream.print(message);
stream.println(ANSI_RESET);
} else {
stream.println(message);
... | [
"private",
"void",
"printMessage",
"(",
"final",
"String",
"message",
",",
"final",
"PrintStream",
"stream",
",",
"final",
"int",
"priority",
")",
"{",
"if",
"(",
"useColor",
"&&",
"priority",
"==",
"Project",
".",
"MSG_ERR",
")",
"{",
"stream",
".",
"prin... | Prints a message to a PrintStream.
@param message The message to print. Should not be <code>null</code>.
@param stream A PrintStream to print the message to. Must not be
<code>null</code>.
@param priority The priority of the message. (Ignored in this
implementation.) | [
"Prints",
"a",
"message",
"to",
"a",
"PrintStream",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L364-L372 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.getTimestamp | protected String getTimestamp() {
final Date date = new Date(System.currentTimeMillis());
final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
return formatter.format(date);
} | java | protected String getTimestamp() {
final Date date = new Date(System.currentTimeMillis());
final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
return formatter.format(date);
} | [
"protected",
"String",
"getTimestamp",
"(",
")",
"{",
"final",
"Date",
"date",
"=",
"new",
"Date",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"final",
"DateFormat",
"formatter",
"=",
"DateFormat",
".",
"getDateTimeInstance",
"(",
"DateFormat"... | Get the current time.
@return the current time as a formatted string.
@since Ant1.7.1 | [
"Get",
"the",
"current",
"time",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L389-L393 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/DefaultLogger.java | DefaultLogger.extractProjectName | protected String extractProjectName(final BuildEvent event) {
final Project project = event.getProject();
return (project != null) ? project.getName() : null;
} | java | protected String extractProjectName(final BuildEvent event) {
final Project project = event.getProject();
return (project != null) ? project.getName() : null;
} | [
"protected",
"String",
"extractProjectName",
"(",
"final",
"BuildEvent",
"event",
")",
"{",
"final",
"Project",
"project",
"=",
"event",
".",
"getProject",
"(",
")",
";",
"return",
"(",
"project",
"!=",
"null",
")",
"?",
"project",
".",
"getName",
"(",
")"... | Get the project name or null
@param event the event
@return the project that raised this event
@since Ant1.7.1 | [
"Get",
"the",
"project",
"name",
"or",
"null"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/DefaultLogger.java#L402-L405 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/TopicRefWriter.java | TopicRefWriter.setup | public void setup(final Map<URI, URI> conflictTable) {
for (final Map.Entry<URI, URI> e: changeTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
this.conflictTable = conflictTable;
} | java | public void setup(final Map<URI, URI> conflictTable) {
for (final Map.Entry<URI, URI> e: changeTable.entrySet()) {
assert e.getKey().isAbsolute();
assert e.getValue().isAbsolute();
}
this.conflictTable = conflictTable;
} | [
"public",
"void",
"setup",
"(",
"final",
"Map",
"<",
"URI",
",",
"URI",
">",
"conflictTable",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"URI",
",",
"URI",
">",
"e",
":",
"changeTable",
".",
"entrySet",
"(",
")",
")",
"{",
"assert",
... | Set up class.
@param conflictTable conflictTable | [
"Set",
"up",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/TopicRefWriter.java#L49-L55 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/TopicRefWriter.java | TopicRefWriter.isLocalDita | private boolean isLocalDita(final Attributes atts) {
final String classValue = atts.getValue(ATTRIBUTE_NAME_CLASS);
if (classValue == null
|| (TOPIC_IMAGE.matches(classValue))) {
return false;
}
String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
... | java | private boolean isLocalDita(final Attributes atts) {
final String classValue = atts.getValue(ATTRIBUTE_NAME_CLASS);
if (classValue == null
|| (TOPIC_IMAGE.matches(classValue))) {
return false;
}
String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
... | [
"private",
"boolean",
"isLocalDita",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"String",
"classValue",
"=",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_CLASS",
")",
";",
"if",
"(",
"classValue",
"==",
"null",
"||",
"(",
"TOPIC_IMAGE",
".",
"ma... | Check whether the attributes contains references
@param atts element attributes
@return {@code true} if local DITA reference, otherwise {@code false} | [
"Check",
"whether",
"the",
"attributes",
"contains",
"references"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/TopicRefWriter.java#L117-L135 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/TopicRefWriter.java | TopicRefWriter.getElementID | private String getElementID(final String relativePath) {
final String fragment = getFragment(relativePath);
if (fragment != null) {
if (fragment.lastIndexOf(SLASH) != -1) {
return fragment.substring(fragment.lastIndexOf(SLASH) + 1);
} else {
return... | java | private String getElementID(final String relativePath) {
final String fragment = getFragment(relativePath);
if (fragment != null) {
if (fragment.lastIndexOf(SLASH) != -1) {
return fragment.substring(fragment.lastIndexOf(SLASH) + 1);
} else {
return... | [
"private",
"String",
"getElementID",
"(",
"final",
"String",
"relativePath",
")",
"{",
"final",
"String",
"fragment",
"=",
"getFragment",
"(",
"relativePath",
")",
";",
"if",
"(",
"fragment",
"!=",
"null",
")",
"{",
"if",
"(",
"fragment",
".",
"lastIndexOf",... | Retrieve the element ID from the path. If there is no element ID, return topic ID. | [
"Retrieve",
"the",
"element",
"ID",
"from",
"the",
"path",
".",
"If",
"there",
"is",
"no",
"element",
"ID",
"return",
"topic",
"ID",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/TopicRefWriter.java#L228-L238 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/DITAOTCollator.java | DITAOTCollator.getInstance | public static DITAOTCollator getInstance(final Locale locale) {
if (locale == null) {
throw new NullPointerException("Locale may not be null");
}
DITAOTCollator instance;
instance = cache.computeIfAbsent(locale, DITAOTCollator::new);
return instance;
} | java | public static DITAOTCollator getInstance(final Locale locale) {
if (locale == null) {
throw new NullPointerException("Locale may not be null");
}
DITAOTCollator instance;
instance = cache.computeIfAbsent(locale, DITAOTCollator::new);
return instance;
} | [
"public",
"static",
"DITAOTCollator",
"getInstance",
"(",
"final",
"Locale",
"locale",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Locale may not be null\"",
")",
";",
"}",
"DITAOTCollator",
"instance",
... | Return the DITAOTCollator instance specifying Locale.
@param locale the locale
@return DITAOTCollator | [
"Return",
"the",
"DITAOTCollator",
"instance",
"specifying",
"Locale",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DITAOTCollator.java#L38-L45 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/DITAOTCollator.java | DITAOTCollator.compare | @Override
public int compare(final Object source, final Object target) {
try {
return (Integer) compareMethod.invoke(collatorInstance, source, target);
} catch (final Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | java | @Override
public int compare(final Object source, final Object target) {
try {
return (Integer) compareMethod.invoke(collatorInstance, source, target);
} catch (final Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"final",
"Object",
"source",
",",
"final",
"Object",
"target",
")",
"{",
"try",
"{",
"return",
"(",
"Integer",
")",
"compareMethod",
".",
"invoke",
"(",
"collatorInstance",
",",
"source",
",",
"target",
")"... | Comparing method required to compare.
@see java.util.Comparator#compare(java.lang.Object, java.lang.Object) | [
"Comparing",
"method",
"required",
"to",
"compare",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/DITAOTCollator.java#L68-L75 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.process | public IndexPreprocessResult process(final Document theInput)
throws ProcessException {
final DocumentBuilder documentBuilder = XMLUtils.getDocumentBuilder();
final Document doc = documentBuilder.newDocument();
final Node rootElement = theInput.getDocumentElement();
final ... | java | public IndexPreprocessResult process(final Document theInput)
throws ProcessException {
final DocumentBuilder documentBuilder = XMLUtils.getDocumentBuilder();
final Document doc = documentBuilder.newDocument();
final Node rootElement = theInput.getDocumentElement();
final ... | [
"public",
"IndexPreprocessResult",
"process",
"(",
"final",
"Document",
"theInput",
")",
"throws",
"ProcessException",
"{",
"final",
"DocumentBuilder",
"documentBuilder",
"=",
"XMLUtils",
".",
"getDocumentBuilder",
"(",
")",
";",
"final",
"Document",
"doc",
"=",
"do... | Process index terms.
@param theInput input document
@return read index terms
@throws ProcessException if processing index terms failed | [
"Process",
"index",
"terms",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L95-L118 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.processCurrNode | private Node[] processCurrNode(final Node theNode, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final NodeList childNodes = theNode.getChildNodes();
if (checkElementName(theNode) && !excludedDraftSection.peek()) {
return processIndexNode(theN... | java | private Node[] processCurrNode(final Node theNode, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final NodeList childNodes = theNode.getChildNodes();
if (checkElementName(theNode) && !excludedDraftSection.peek()) {
return processIndexNode(theN... | [
"private",
"Node",
"[",
"]",
"processCurrNode",
"(",
"final",
"Node",
"theNode",
",",
"final",
"Document",
"theTargetDocument",
",",
"final",
"IndexEntryFoundListener",
"theIndexEntryFoundListener",
")",
"{",
"final",
"NodeList",
"childNodes",
"=",
"theNode",
".",
"... | Processes curr node. Copies node to the target document if its is not a text node of index entry element.
Otherwise it process it and creates nodes with "prefix" in given "namespace_url" from the parsed index entry text.
@param theNode node to process
@param theTargetDocument target documen... | [
"Processes",
"curr",
"node",
".",
"Copies",
"node",
"to",
"the",
"target",
"document",
"if",
"its",
"is",
"not",
"a",
"text",
"node",
"of",
"index",
"entry",
"element",
".",
"Otherwise",
"it",
"process",
"it",
"and",
"creates",
"nodes",
"with",
"prefix",
... | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L161-L182 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.checkElementName | private boolean checkElementName(final Node node) {
return TOPIC_INDEXTERM.matches(node)
|| INDEXING_D_INDEX_SORT_AS.matches(node)
|| INDEXING_D_INDEX_SEE.matches(node)
|| INDEXING_D_INDEX_SEE_ALSO.matches(node);
} | java | private boolean checkElementName(final Node node) {
return TOPIC_INDEXTERM.matches(node)
|| INDEXING_D_INDEX_SORT_AS.matches(node)
|| INDEXING_D_INDEX_SEE.matches(node)
|| INDEXING_D_INDEX_SEE_ALSO.matches(node);
} | [
"private",
"boolean",
"checkElementName",
"(",
"final",
"Node",
"node",
")",
"{",
"return",
"TOPIC_INDEXTERM",
".",
"matches",
"(",
"node",
")",
"||",
"INDEXING_D_INDEX_SORT_AS",
".",
"matches",
"(",
"node",
")",
"||",
"INDEXING_D_INDEX_SEE",
".",
"matches",
"("... | Check if node is an index term element or specialization of one.
@param node element to test
@return {@code true} if node is an index term element, otherwise {@code false} | [
"Check",
"if",
"node",
"is",
"an",
"index",
"term",
"element",
"or",
"specialization",
"of",
"one",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L248-L253 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.processIndexString | private Node[] processIndexString(final String theIndexString, final List<Node> contents, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final IndexEntry[] indexEntries = IndexStringProcessor.processIndexString(theIndexString, contents);
for (final IndexE... | java | private Node[] processIndexString(final String theIndexString, final List<Node> contents, final Document theTargetDocument, final IndexEntryFoundListener theIndexEntryFoundListener) {
final IndexEntry[] indexEntries = IndexStringProcessor.processIndexString(theIndexString, contents);
for (final IndexE... | [
"private",
"Node",
"[",
"]",
"processIndexString",
"(",
"final",
"String",
"theIndexString",
",",
"final",
"List",
"<",
"Node",
">",
"contents",
",",
"final",
"Document",
"theTargetDocument",
",",
"final",
"IndexEntryFoundListener",
"theIndexEntryFoundListener",
")",
... | Processes index string and creates nodes with "prefix" in given "namespace_url" from the parsed index entry text.
@param theIndexString index string
param contents index contents
@param theTargetDocument target document to create new nodes
@param theIndexEntryFoundListener listener to notify that ... | [
"Processes",
"index",
"string",
"and",
"creates",
"nodes",
"with",
"prefix",
"in",
"given",
"namespace_url",
"from",
"the",
"parsed",
"index",
"entry",
"text",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L269-L278 | train |
dita-ot/dita-ot | src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java | IndexPreprocessor.createElement | private Element createElement(final Document theTargetDocument, final String theName) {
final Element indexEntryNode = theTargetDocument.createElementNS(this.namespace_url, theName);
indexEntryNode.setPrefix(this.prefix);
return indexEntryNode;
} | java | private Element createElement(final Document theTargetDocument, final String theName) {
final Element indexEntryNode = theTargetDocument.createElementNS(this.namespace_url, theName);
indexEntryNode.setPrefix(this.prefix);
return indexEntryNode;
} | [
"private",
"Element",
"createElement",
"(",
"final",
"Document",
"theTargetDocument",
",",
"final",
"String",
"theName",
")",
"{",
"final",
"Element",
"indexEntryNode",
"=",
"theTargetDocument",
".",
"createElementNS",
"(",
"this",
".",
"namespace_url",
",",
"theNam... | Creates element with "prefix" in "namespace_url" with given name for the target document
@param theTargetDocument target document
@param theName name
@return new element | [
"Creates",
"element",
"with",
"prefix",
"in",
"namespace_url",
"with",
"given",
"name",
"for",
"the",
"target",
"document"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.pdf2/src/com/idiominc/ws/opentopic/fo/index2/IndexPreprocessor.java#L388-L392 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.getNonTopicrefReferenceSet | public Set<URI> getNonTopicrefReferenceSet() {
final Set<URI> res = new HashSet<>(nonTopicrefReferenceSet);
res.removeAll(normalProcessingRoleSet);
res.removeAll(resourceOnlySet);
return res;
} | java | public Set<URI> getNonTopicrefReferenceSet() {
final Set<URI> res = new HashSet<>(nonTopicrefReferenceSet);
res.removeAll(normalProcessingRoleSet);
res.removeAll(resourceOnlySet);
return res;
} | [
"public",
"Set",
"<",
"URI",
">",
"getNonTopicrefReferenceSet",
"(",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"res",
"=",
"new",
"HashSet",
"<>",
"(",
"nonTopicrefReferenceSet",
")",
";",
"res",
".",
"removeAll",
"(",
"normalProcessingRoleSet",
")",
";",
... | List of files referenced by something other than topicref
@return the resource-only set | [
"List",
"of",
"files",
"referenced",
"by",
"something",
"other",
"than",
"topicref"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L147-L152 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.getNonCopytoResult | public Set<Reference> getNonCopytoResult() {
final Set<Reference> nonCopytoSet = new LinkedHashSet<>(128);
nonCopytoSet.addAll(nonConrefCopytoTargets);
for (final URI f : conrefTargets) {
nonCopytoSet.add(new Reference(stripFragment(f), currentFileFormat()));
}
for (... | java | public Set<Reference> getNonCopytoResult() {
final Set<Reference> nonCopytoSet = new LinkedHashSet<>(128);
nonCopytoSet.addAll(nonConrefCopytoTargets);
for (final URI f : conrefTargets) {
nonCopytoSet.add(new Reference(stripFragment(f), currentFileFormat()));
}
for (... | [
"public",
"Set",
"<",
"Reference",
">",
"getNonCopytoResult",
"(",
")",
"{",
"final",
"Set",
"<",
"Reference",
">",
"nonCopytoSet",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
"128",
")",
";",
"nonCopytoSet",
".",
"addAll",
"(",
"nonConrefCopytoTargets",
")",
";... | Get all targets except copy-to.
@return set of target file path with option format after
{@link org.dita.dost.util.Constants#STICK STICK} | [
"Get",
"all",
"targets",
"except",
"copy",
"-",
"to",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L245-L262 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.getNonConrefCopytoTargets | public Set<URI> getNonConrefCopytoTargets() {
final Set<URI> res = new HashSet<>(nonConrefCopytoTargets.size());
for (final Reference r : nonConrefCopytoTargets) {
res.add(r.filename);
}
return res;
} | java | public Set<URI> getNonConrefCopytoTargets() {
final Set<URI> res = new HashSet<>(nonConrefCopytoTargets.size());
for (final Reference r : nonConrefCopytoTargets) {
res.add(r.filename);
}
return res;
} | [
"public",
"Set",
"<",
"URI",
">",
"getNonConrefCopytoTargets",
"(",
")",
"{",
"final",
"Set",
"<",
"URI",
">",
"res",
"=",
"new",
"HashSet",
"<>",
"(",
"nonConrefCopytoTargets",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"final",
"Reference",
"r",
":... | Get non-conref and non-copyto targets.
@return Returns the nonConrefCopytoTargets. | [
"Get",
"non",
"-",
"conref",
"and",
"non",
"-",
"copyto",
"targets",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L314-L320 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.canFollow | public static boolean canFollow(URI href) {
if (href != null && href.getScheme() != null && href.getScheme().equals("mailto")) {
return false;
}
return true;
} | java | public static boolean canFollow(URI href) {
if (href != null && href.getScheme() != null && href.getScheme().equals("mailto")) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"canFollow",
"(",
"URI",
"href",
")",
"{",
"if",
"(",
"href",
"!=",
"null",
"&&",
"href",
".",
"getScheme",
"(",
")",
"!=",
"null",
"&&",
"href",
".",
"getScheme",
"(",
")",
".",
"equals",
"(",
"\"mailto\"",
")",
")",
... | Make educated guess in advance whether URI can be resolved to a file. | [
"Make",
"educated",
"guess",
"in",
"advance",
"whether",
"URI",
"can",
"be",
"resolved",
"to",
"a",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L639-L644 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/GenListModuleReader.java | GenListModuleReader.isOutFile | private boolean isOutFile(final URI toCheckPath) {
final String path = toCheckPath.getPath();
return !(path != null && path.startsWith(rootDir.getPath()));
} | java | private boolean isOutFile(final URI toCheckPath) {
final String path = toCheckPath.getPath();
return !(path != null && path.startsWith(rootDir.getPath()));
} | [
"private",
"boolean",
"isOutFile",
"(",
"final",
"URI",
"toCheckPath",
")",
"{",
"final",
"String",
"path",
"=",
"toCheckPath",
".",
"getPath",
"(",
")",
";",
"return",
"!",
"(",
"path",
"!=",
"null",
"&&",
"path",
".",
"startsWith",
"(",
"rootDir",
".",... | Check if path walks up in parent directories
@param toCheckPath path to check
@return {@code true} if path walks up, otherwise {@code false} | [
"Check",
"if",
"path",
"walks",
"up",
"in",
"parent",
"directories"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/GenListModuleReader.java#L742-L745 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/FileGenerator.java | FileGenerator.generate | public void generate(final File fileName) {
final File outputFile = removeTemplatePrefix(fileName);
templateFile = fileName;
try (final InputStream in = new BufferedInputStream(new FileInputStream(fileName));
final OutputStream out = new BufferedOutputStream(new FileOutputStream(ou... | java | public void generate(final File fileName) {
final File outputFile = removeTemplatePrefix(fileName);
templateFile = fileName;
try (final InputStream in = new BufferedInputStream(new FileInputStream(fileName));
final OutputStream out = new BufferedOutputStream(new FileOutputStream(ou... | [
"public",
"void",
"generate",
"(",
"final",
"File",
"fileName",
")",
"{",
"final",
"File",
"outputFile",
"=",
"removeTemplatePrefix",
"(",
"fileName",
")",
";",
"templateFile",
"=",
"fileName",
";",
"try",
"(",
"final",
"InputStream",
"in",
"=",
"new",
"Buff... | Generator the output file.
@param fileName filename | [
"Generator",
"the",
"output",
"file",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/FileGenerator.java#L82-L104 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java | RelaxNGDefaultValues.update | public void update(InputSource in) throws SAXException {
defaultValuesCollector = null;
PropertyMapBuilder builder = new PropertyMapBuilder();
//Set the resolver
builder.put(ValidateProperty.RESOLVER, resolver);
builder.put(ValidateProperty.ERROR_HANDLER, eh);
PropertyMap properties = builder.... | java | public void update(InputSource in) throws SAXException {
defaultValuesCollector = null;
PropertyMapBuilder builder = new PropertyMapBuilder();
//Set the resolver
builder.put(ValidateProperty.RESOLVER, resolver);
builder.put(ValidateProperty.ERROR_HANDLER, eh);
PropertyMap properties = builder.... | [
"public",
"void",
"update",
"(",
"InputSource",
"in",
")",
"throws",
"SAXException",
"{",
"defaultValuesCollector",
"=",
"null",
";",
"PropertyMapBuilder",
"builder",
"=",
"new",
"PropertyMapBuilder",
"(",
")",
";",
"//Set the resolver",
"builder",
".",
"put",
"("... | Updates the annotation model.
@param in The schema input source. | [
"Updates",
"the",
"annotation",
"model",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java#L147-L165 | train |
dita-ot/dita-ot | src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java | RelaxNGDefaultValues.getDefaultAttributes | public List<Attribute> getDefaultAttributes(String localName, String namespace) {
if (defaultValuesCollector != null) {
return defaultValuesCollector.getDefaultAttributes(localName, namespace);
}
return null;
} | java | public List<Attribute> getDefaultAttributes(String localName, String namespace) {
if (defaultValuesCollector != null) {
return defaultValuesCollector.getDefaultAttributes(localName, namespace);
}
return null;
} | [
"public",
"List",
"<",
"Attribute",
">",
"getDefaultAttributes",
"(",
"String",
"localName",
",",
"String",
"namespace",
")",
"{",
"if",
"(",
"defaultValuesCollector",
"!=",
"null",
")",
"{",
"return",
"defaultValuesCollector",
".",
"getDefaultAttributes",
"(",
"l... | Get the default attributes for an element.
@param localName
The element local name.
@param namespace
The element namespace. Use null or empty for no namespace.
@return A list of Attribute objects or null if no defaults. | [
"Get",
"the",
"default",
"attributes",
"for",
"an",
"element",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/ditang/relaxng/defaults/RelaxNGDefaultValues.java#L176-L181 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleID | private void handleID(final AttributesImpl atts) {
String idValue = atts.getValue(ATTRIBUTE_NAME_ID);
if (idValue != null) {
XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_OID, idValue);
final URI value = setFragment(dirPath.toURI().resolve(toURI(filePath)), idValue);
... | java | private void handleID(final AttributesImpl atts) {
String idValue = atts.getValue(ATTRIBUTE_NAME_ID);
if (idValue != null) {
XMLUtils.addOrSetAttribute(atts, ATTRIBUTE_NAME_OID, idValue);
final URI value = setFragment(dirPath.toURI().resolve(toURI(filePath)), idValue);
... | [
"private",
"void",
"handleID",
"(",
"final",
"AttributesImpl",
"atts",
")",
"{",
"String",
"idValue",
"=",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_ID",
")",
";",
"if",
"(",
"idValue",
"!=",
"null",
")",
"{",
"XMLUtils",
".",
"addOrSetAttribute",
"(",
... | Get new value for topic id attribute. | [
"Get",
"new",
"value",
"for",
"topic",
"id",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L104-L116 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleLocalDita | private URI handleLocalDita(final URI href, final AttributesImpl atts) {
final URI attValue = href;
final int sharpIndex = attValue.toString().indexOf(SHARP);
URI pathFromMap;
URI retAttValue;
if (sharpIndex != -1) { // href value refer to an id in a topic
if (sharpIn... | java | private URI handleLocalDita(final URI href, final AttributesImpl atts) {
final URI attValue = href;
final int sharpIndex = attValue.toString().indexOf(SHARP);
URI pathFromMap;
URI retAttValue;
if (sharpIndex != -1) { // href value refer to an id in a topic
if (sharpIn... | [
"private",
"URI",
"handleLocalDita",
"(",
"final",
"URI",
"href",
",",
"final",
"AttributesImpl",
"atts",
")",
"{",
"final",
"URI",
"attValue",
"=",
"href",
";",
"final",
"int",
"sharpIndex",
"=",
"attValue",
".",
"toString",
"(",
")",
".",
"indexOf",
"(",... | Rewrite local DITA href value.
@param href href attribute value
@return rewritten href value | [
"Rewrite",
"local",
"DITA",
"href",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L124-L165 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.parse | public void parse(final String filename, final File dir) {
filePath = stripFragment(filename);
dirPath = dir;
try {
final File f = new File(dir, filePath);
reader.setErrorHandler(new DITAOTXMLErrorHandler(f.getAbsolutePath(), logger));
logger.info("Processing ... | java | public void parse(final String filename, final File dir) {
filePath = stripFragment(filename);
dirPath = dir;
try {
final File f = new File(dir, filePath);
reader.setErrorHandler(new DITAOTXMLErrorHandler(f.getAbsolutePath(), logger));
logger.info("Processing ... | [
"public",
"void",
"parse",
"(",
"final",
"String",
"filename",
",",
"final",
"File",
"dir",
")",
"{",
"filePath",
"=",
"stripFragment",
"(",
"filename",
")",
";",
"dirPath",
"=",
"dir",
";",
"try",
"{",
"final",
"File",
"f",
"=",
"new",
"File",
"(",
... | Parse the file to update id.
@param filename relative topic system path, may contain a fragment part
@param dir topic directory system path | [
"Parse",
"the",
"file",
"to",
"update",
"id",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L178-L191 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleHref | private void handleHref(final String classValue, final AttributesImpl atts) {
final URI attValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
if (attValue != null) {
final String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
if ((scopeValue == null || ATTR_SCOPE_VALUE_LOCAL.e... | java | private void handleHref(final String classValue, final AttributesImpl atts) {
final URI attValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
if (attValue != null) {
final String scopeValue = atts.getValue(ATTRIBUTE_NAME_SCOPE);
if ((scopeValue == null || ATTR_SCOPE_VALUE_LOCAL.e... | [
"private",
"void",
"handleHref",
"(",
"final",
"String",
"classValue",
",",
"final",
"AttributesImpl",
"atts",
")",
"{",
"final",
"URI",
"attValue",
"=",
"toURI",
"(",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_HREF",
")",
")",
";",
"if",
"(",
"attValue",... | Rewrite href attribute.
@param classValue element class value
@param atts attributes | [
"Rewrite",
"href",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L228-L251 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/MergeTopicParser.java | MergeTopicParser.handleLocalHref | private URI handleLocalHref(final URI attValue) {
final URI current = new File(dirPath, filePath).toURI().normalize();
final URI reference = current.resolve(attValue);
final URI merge = output.toURI();
return getRelativePath(merge, reference);
} | java | private URI handleLocalHref(final URI attValue) {
final URI current = new File(dirPath, filePath).toURI().normalize();
final URI reference = current.resolve(attValue);
final URI merge = output.toURI();
return getRelativePath(merge, reference);
} | [
"private",
"URI",
"handleLocalHref",
"(",
"final",
"URI",
"attValue",
")",
"{",
"final",
"URI",
"current",
"=",
"new",
"File",
"(",
"dirPath",
",",
"filePath",
")",
".",
"toURI",
"(",
")",
".",
"normalize",
"(",
")",
";",
"final",
"URI",
"reference",
"... | Rewrite local non-DITA href value.
@param attValue href attribute value
@return rewritten href value | [
"Rewrite",
"local",
"non",
"-",
"DITA",
"href",
"value",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/MergeTopicParser.java#L259-L264 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.start | public static void start(final String[] args, final Properties additionalUserProperties,
final ClassLoader coreLoader) {
final Main m = new Main();
m.startAnt(args, additionalUserProperties, coreLoader);
} | java | public static void start(final String[] args, final Properties additionalUserProperties,
final ClassLoader coreLoader) {
final Main m = new Main();
m.startAnt(args, additionalUserProperties, coreLoader);
} | [
"public",
"static",
"void",
"start",
"(",
"final",
"String",
"[",
"]",
"args",
",",
"final",
"Properties",
"additionalUserProperties",
",",
"final",
"ClassLoader",
"coreLoader",
")",
"{",
"final",
"Main",
"m",
"=",
"new",
"Main",
"(",
")",
";",
"m",
".",
... | Creates a new instance of this class using the arguments specified, gives
it any extra user properties which have been specified, and then runs the
build using the classloader provided.
@param args Command line arguments. Must not be <code>null</code>.
@param additionalUserProperties Any extra prop... | [
"Creates",
"a",
"new",
"instance",
"of",
"this",
"class",
"using",
"the",
"arguments",
"specified",
"gives",
"it",
"any",
"extra",
"user",
"properties",
"which",
"have",
"been",
"specified",
"and",
"then",
"runs",
"the",
"build",
"using",
"the",
"classloader",... | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L140-L144 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.handleLogfile | private void handleLogfile() {
if (args.logFile != null) {
FileUtils.close(out);
FileUtils.close(err);
}
} | java | private void handleLogfile() {
if (args.logFile != null) {
FileUtils.close(out);
FileUtils.close(err);
}
} | [
"private",
"void",
"handleLogfile",
"(",
")",
"{",
"if",
"(",
"args",
".",
"logFile",
"!=",
"null",
")",
"{",
"FileUtils",
".",
"close",
"(",
"out",
")",
";",
"FileUtils",
".",
"close",
"(",
"err",
")",
";",
"}",
"}"
] | Close logfiles, if we have been writing to them.
@since Ant 1.6 | [
"Close",
"logfiles",
"if",
"we",
"have",
"been",
"writing",
"to",
"them",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L233-L238 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.addBuildListeners | @Override
protected void addBuildListeners(final Project project) {
// Add the default listener
project.addBuildListener(createLogger());
final int count = args.listeners.size();
for (int i = 0; i < count; i++) {
final String className = args.listeners.elementAt(i);
... | java | @Override
protected void addBuildListeners(final Project project) {
// Add the default listener
project.addBuildListener(createLogger());
final int count = args.listeners.size();
for (int i = 0; i < count; i++) {
final String className = args.listeners.elementAt(i);
... | [
"@",
"Override",
"protected",
"void",
"addBuildListeners",
"(",
"final",
"Project",
"project",
")",
"{",
"// Add the default listener",
"project",
".",
"addBuildListener",
"(",
"createLogger",
"(",
")",
")",
";",
"final",
"int",
"count",
"=",
"args",
".",
"liste... | Adds the listeners specified in the command line arguments, along with
the default listener, to the specified project.
@param project The project to add listeners to. Must not be
<code>null</code>. | [
"Adds",
"the",
"listeners",
"specified",
"in",
"the",
"command",
"line",
"arguments",
"along",
"with",
"the",
"default",
"listener",
"to",
"the",
"specified",
"project",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L666-L680 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.addInputHandler | private void addInputHandler(final Project project) throws BuildException {
final InputHandler handler;
if (args.inputHandlerClassname == null) {
handler = new DefaultInputHandler();
} else {
handler = ClasspathUtils.newInstance(args.inputHandlerClassname, Main.class.getC... | java | private void addInputHandler(final Project project) throws BuildException {
final InputHandler handler;
if (args.inputHandlerClassname == null) {
handler = new DefaultInputHandler();
} else {
handler = ClasspathUtils.newInstance(args.inputHandlerClassname, Main.class.getC... | [
"private",
"void",
"addInputHandler",
"(",
"final",
"Project",
"project",
")",
"throws",
"BuildException",
"{",
"final",
"InputHandler",
"handler",
";",
"if",
"(",
"args",
".",
"inputHandlerClassname",
"==",
"null",
")",
"{",
"handler",
"=",
"new",
"DefaultInput... | Creates the InputHandler and adds it to the project.
@param project the project instance.
@throws BuildException if a specified InputHandler implementation
could not be loaded. | [
"Creates",
"the",
"InputHandler",
"and",
"adds",
"it",
"to",
"the",
"project",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L689-L699 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/invoker/Main.java | Main.createLogger | private BuildLogger createLogger() {
BuildLogger logger;
if (args.loggerClassname != null) {
try {
logger = ClasspathUtils.newInstance(args.loggerClassname, Main.class.getClassLoader(),
BuildLogger.class);
} catch (final BuildException e) {... | java | private BuildLogger createLogger() {
BuildLogger logger;
if (args.loggerClassname != null) {
try {
logger = ClasspathUtils.newInstance(args.loggerClassname, Main.class.getClassLoader(),
BuildLogger.class);
} catch (final BuildException e) {... | [
"private",
"BuildLogger",
"createLogger",
"(",
")",
"{",
"BuildLogger",
"logger",
";",
"if",
"(",
"args",
".",
"loggerClassname",
"!=",
"null",
")",
"{",
"try",
"{",
"logger",
"=",
"ClasspathUtils",
".",
"newInstance",
"(",
"args",
".",
"loggerClassname",
",... | Creates the default build logger for sending build events to the ant log.
@return the logger instance for this build. | [
"Creates",
"the",
"default",
"build",
"logger",
"for",
"sending",
"build",
"events",
"to",
"the",
"ant",
"log",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/invoker/Main.java#L711-L733 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/XsltModule.java | XsltModule.configureSaxonExtensions | private void configureSaxonExtensions(SaxonTransformerFactory tfi) {
final net.sf.saxon.Configuration conf = tfi.getConfiguration();
for (ExtensionFunctionDefinition def : ServiceLoader.load(ExtensionFunctionDefinition.class)) {
try {
conf.registerExtensionFunction(def.getCla... | java | private void configureSaxonExtensions(SaxonTransformerFactory tfi) {
final net.sf.saxon.Configuration conf = tfi.getConfiguration();
for (ExtensionFunctionDefinition def : ServiceLoader.load(ExtensionFunctionDefinition.class)) {
try {
conf.registerExtensionFunction(def.getCla... | [
"private",
"void",
"configureSaxonExtensions",
"(",
"SaxonTransformerFactory",
"tfi",
")",
"{",
"final",
"net",
".",
"sf",
".",
"saxon",
".",
"Configuration",
"conf",
"=",
"tfi",
".",
"getConfiguration",
"(",
")",
";",
"for",
"(",
"ExtensionFunctionDefinition",
... | Registers Saxon full integrated function definitions.
The intgrated function should be an instance of net.sf.saxon.lib.ExtensionFunctionDefinition abstract class.
@see <a href="https://www.saxonica.com/html/documentation/extensibility/integratedfunctions/ext-full-J.html">Saxon
Java extension functions: full interface</... | [
"Registers",
"Saxon",
"full",
"integrated",
"function",
"definitions",
".",
"The",
"intgrated",
"function",
"should",
"be",
"an",
"instance",
"of",
"net",
".",
"sf",
".",
"saxon",
".",
"lib",
".",
"ExtensionFunctionDefinition",
"abstract",
"class",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/XsltModule.java#L272-L284 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/KeyDef.java | KeyDef.writeKeydef | public static void writeKeydef(final File keydefFile, final Collection<KeyDef> keydefs) throws DITAOTException {
XMLStreamWriter keydef = null;
try (OutputStream out = new FileOutputStream(keydefFile)) {
keydef = XMLOutputFactory.newInstance().createXMLStreamWriter(out, "UTF-8");
... | java | public static void writeKeydef(final File keydefFile, final Collection<KeyDef> keydefs) throws DITAOTException {
XMLStreamWriter keydef = null;
try (OutputStream out = new FileOutputStream(keydefFile)) {
keydef = XMLOutputFactory.newInstance().createXMLStreamWriter(out, "UTF-8");
... | [
"public",
"static",
"void",
"writeKeydef",
"(",
"final",
"File",
"keydefFile",
",",
"final",
"Collection",
"<",
"KeyDef",
">",
"keydefs",
")",
"throws",
"DITAOTException",
"{",
"XMLStreamWriter",
"keydef",
"=",
"null",
";",
"try",
"(",
"OutputStream",
"out",
"... | Write key definition XML configuration file
@param keydefFile key definition file
@param keydefs list of key definitions
@throws DITAOTException if writing configuration file failed | [
"Write",
"key",
"definition",
"XML",
"configuration",
"file"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/KeyDef.java#L87-L121 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.getTopicrefs | private List<Element> getTopicrefs(final Element root) {
final List<Element> res = new ArrayList<>();
final NodeList all = root.getElementsByTagName("*");
for (int i = 0; i < all.getLength(); i++) {
final Element elem = (Element) all.item(i);
if (MAP_TOPICREF.matches(elem... | java | private List<Element> getTopicrefs(final Element root) {
final List<Element> res = new ArrayList<>();
final NodeList all = root.getElementsByTagName("*");
for (int i = 0; i < all.getLength(); i++) {
final Element elem = (Element) all.item(i);
if (MAP_TOPICREF.matches(elem... | [
"private",
"List",
"<",
"Element",
">",
"getTopicrefs",
"(",
"final",
"Element",
"root",
")",
"{",
"final",
"List",
"<",
"Element",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"NodeList",
"all",
"=",
"root",
".",
"getElementsByTagN... | Get all topicrefs | [
"Get",
"all",
"topicrefs"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L263-L275 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.generateCopies | private void generateCopies(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String copyTo = topicref.getAttribute(BRANCH_COPY_TO);
if (!copyTo.isEmpty()) {
final URI dstUri = map.resolve(copyTo);
... | java | private void generateCopies(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String copyTo = topicref.getAttribute(BRANCH_COPY_TO);
if (!copyTo.isEmpty()) {
final URI dstUri = map.resolve(copyTo);
... | [
"private",
"void",
"generateCopies",
"(",
"final",
"Element",
"topicref",
",",
"final",
"List",
"<",
"FilterUtils",
">",
"filters",
")",
"{",
"final",
"List",
"<",
"FilterUtils",
">",
"fs",
"=",
"combineFilterUtils",
"(",
"topicref",
",",
"filters",
")",
";"... | Copy and filter topics for branches. These topics have a new name and will be added to job configuration. | [
"Copy",
"and",
"filter",
"topics",
"for",
"branches",
".",
"These",
"topics",
"have",
"a",
"new",
"name",
"and",
"will",
"be",
"added",
"to",
"job",
"configuration",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L342-L388 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.filterTopics | private void filterTopics(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String href = topicref.getAttribute(ATTRIBUTE_NAME_HREF);
final Attr skipFilter = topicref.getAttributeNode(SKIP_FILTER);
final ... | java | private void filterTopics(final Element topicref, final List<FilterUtils> filters) {
final List<FilterUtils> fs = combineFilterUtils(topicref, filters);
final String href = topicref.getAttribute(ATTRIBUTE_NAME_HREF);
final Attr skipFilter = topicref.getAttributeNode(SKIP_FILTER);
final ... | [
"private",
"void",
"filterTopics",
"(",
"final",
"Element",
"topicref",
",",
"final",
"List",
"<",
"FilterUtils",
">",
"filters",
")",
"{",
"final",
"List",
"<",
"FilterUtils",
">",
"fs",
"=",
"combineFilterUtils",
"(",
"topicref",
",",
"filters",
")",
";",
... | Modify and filter topics for branches. These files use an existing file name. | [
"Modify",
"and",
"filter",
"topics",
"for",
"branches",
".",
"These",
"files",
"use",
"an",
"existing",
"file",
"name",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L391-L428 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/BranchFilterModule.java | BranchFilterModule.getFilterUtils | private FilterUtils getFilterUtils(final Element ditavalRef) {
if (ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF).isEmpty()) {
return null;
}
final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
final URI tmp = currentFile.resolve(href);
final FileInfo ... | java | private FilterUtils getFilterUtils(final Element ditavalRef) {
if (ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF).isEmpty()) {
return null;
}
final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
final URI tmp = currentFile.resolve(href);
final FileInfo ... | [
"private",
"FilterUtils",
"getFilterUtils",
"(",
"final",
"Element",
"ditavalRef",
")",
"{",
"if",
"(",
"ditavalRef",
".",
"getAttribute",
"(",
"ATTRIBUTE_NAME_HREF",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URI",
"href"... | Read and cache filter. | [
"Read",
"and",
"cache",
"filter",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/BranchFilterModule.java#L433-L452 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/KeydefFilter.java | KeydefFilter.handleKeysAttr | private void handleKeysAttr(final Attributes atts) {
final String attrValue = atts.getValue(ATTRIBUTE_NAME_KEYS);
if (attrValue != null) {
URI target = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
final URI copyTo = toURI(atts.getValue(ATTRIBUTE_NAME_COPY_TO));
if (copy... | java | private void handleKeysAttr(final Attributes atts) {
final String attrValue = atts.getValue(ATTRIBUTE_NAME_KEYS);
if (attrValue != null) {
URI target = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
final URI copyTo = toURI(atts.getValue(ATTRIBUTE_NAME_COPY_TO));
if (copy... | [
"private",
"void",
"handleKeysAttr",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"String",
"attrValue",
"=",
"atts",
".",
"getValue",
"(",
"ATTRIBUTE_NAME_KEYS",
")",
";",
"if",
"(",
"attrValue",
"!=",
"null",
")",
"{",
"URI",
"target",
"=",
"to... | Parse the keys attributes.
@param atts all attributes | [
"Parse",
"the",
"keys",
"attributes",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/KeydefFilter.java#L107-L151 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/KeydefFilter.java | KeydefFilter.getKeysList | private List<String> getKeysList(final String key, final Map<String, String> keysRefMap) {
final List<String> list = new ArrayList<>();
// Iterate the map to look for multi-level keys
for (Entry<String, String> entry : keysRefMap.entrySet()) {
// Multi-level key found
if ... | java | private List<String> getKeysList(final String key, final Map<String, String> keysRefMap) {
final List<String> list = new ArrayList<>();
// Iterate the map to look for multi-level keys
for (Entry<String, String> entry : keysRefMap.entrySet()) {
// Multi-level key found
if ... | [
"private",
"List",
"<",
"String",
">",
"getKeysList",
"(",
"final",
"String",
"key",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"keysRefMap",
")",
"{",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Get multi-level keys list | [
"Get",
"multi",
"-",
"level",
"keys",
"list"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/KeydefFilter.java#L156-L174 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/reader/KeydefFilter.java | KeydefFilter.checkMultiLevelKeys | private void checkMultiLevelKeys(final Map<String, KeyDef> keysDefMap, final Map<String, String> keysRefMap) {
String key;
KeyDef value;
// tempMap storing values to avoid ConcurrentModificationException
final Map<String, KeyDef> tempMap = new HashMap<>();
for (Entry<String, KeyD... | java | private void checkMultiLevelKeys(final Map<String, KeyDef> keysDefMap, final Map<String, String> keysRefMap) {
String key;
KeyDef value;
// tempMap storing values to avoid ConcurrentModificationException
final Map<String, KeyDef> tempMap = new HashMap<>();
for (Entry<String, KeyD... | [
"private",
"void",
"checkMultiLevelKeys",
"(",
"final",
"Map",
"<",
"String",
",",
"KeyDef",
">",
"keysDefMap",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"keysRefMap",
")",
"{",
"String",
"key",
";",
"KeyDef",
"value",
";",
"// tempMap storing ... | Update keysDefMap for multi-level keys | [
"Update",
"keysDefMap",
"for",
"multi",
"-",
"level",
"keys"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/reader/KeydefFilter.java#L179-L199 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.setValidateMap | public void setValidateMap(final Map<QName, Map<String, Set<String>>> validateMap) {
this.validateMap = validateMap;
} | java | public void setValidateMap(final Map<QName, Map<String, Set<String>>> validateMap) {
this.validateMap = validateMap;
} | [
"public",
"void",
"setValidateMap",
"(",
"final",
"Map",
"<",
"QName",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
">",
"validateMap",
")",
"{",
"this",
".",
"validateMap",
"=",
"validateMap",
";",
"}"
] | Set valid attribute values.
<p>The contents of the map is in pseudo-code
{@code Map<AttName, Map<ElemName, <Set<Value>>>}.
For default element mapping, the value is {@code *}. | [
"Set",
"valid",
"attribute",
"values",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L56-L58 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateAttributeValues | private void validateAttributeValues(final String qName, final Attributes atts) {
if (validateMap.isEmpty()) {
return;
}
for (int i = 0; i < atts.getLength(); i++) {
final QName attrName = new QName(atts.getURI(i), atts.getLocalName(i));
final Map<String, Set<... | java | private void validateAttributeValues(final String qName, final Attributes atts) {
if (validateMap.isEmpty()) {
return;
}
for (int i = 0; i < atts.getLength(); i++) {
final QName attrName = new QName(atts.getURI(i), atts.getLocalName(i));
final Map<String, Set<... | [
"private",
"void",
"validateAttributeValues",
"(",
"final",
"String",
"qName",
",",
"final",
"Attributes",
"atts",
")",
"{",
"if",
"(",
"validateMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Validate attribute values
@param qName element name
@param atts attributes | [
"Validate",
"attribute",
"values"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L250-L274 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateAttributeGeneralization | private void validateAttributeGeneralization(final Attributes atts) {
final QName[][] d = domains.peekFirst();
if (d != null) {
for (final QName[] spec: d) {
for (int i = spec.length - 1; i > -1; i--) {
if (atts.getValue(spec[i].getNamespaceURI(), spec[i].... | java | private void validateAttributeGeneralization(final Attributes atts) {
final QName[][] d = domains.peekFirst();
if (d != null) {
for (final QName[] spec: d) {
for (int i = spec.length - 1; i > -1; i--) {
if (atts.getValue(spec[i].getNamespaceURI(), spec[i].... | [
"private",
"void",
"validateAttributeGeneralization",
"(",
"final",
"Attributes",
"atts",
")",
"{",
"final",
"QName",
"[",
"]",
"[",
"]",
"d",
"=",
"domains",
".",
"peekFirst",
"(",
")",
";",
"if",
"(",
"d",
"!=",
"null",
")",
"{",
"for",
"(",
"final",... | Validate attribute generalization. A single element may not contain both generalized and specialized values for the same attribute.
@param atts attributes
@see <a href="http://docs.oasis-open.org/dita/v1.2/os/spec/archSpec/attributegeneralize.html">DITA 1.2 specification</a> | [
"Validate",
"attribute",
"generalization",
".",
"A",
"single",
"element",
"may",
"not",
"contain",
"both",
"generalized",
"and",
"specialized",
"values",
"for",
"the",
"same",
"attribute",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L351-L367 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.addId | public String addId(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
index ++;
final String newId = PREFIX + Integer.toString(index);
idMap.put(localId, newId);
return newId;
} | java | public String addId(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
index ++;
final String newId = PREFIX + Integer.toString(index);
idMap.put(localId, newId);
return newId;
} | [
"public",
"String",
"addId",
"(",
"final",
"URI",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URI",
"localId",
"=",
"id",
".",
"normalize",
"(",
")",
";",
"index",
"++",
";",
"final",
"String",
"... | Add topic id to the idMap.
@param id topic id
@return updated topic id | [
"Add",
"topic",
"id",
"to",
"the",
"idMap",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L72-L81 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.addId | public void addId(final URI id, final String value) {
if (id != null && value != null) {
final URI localId = id.normalize();
final String localValue = value.trim();
idMap.put(localId, localValue);
}
} | java | public void addId(final URI id, final String value) {
if (id != null && value != null) {
final URI localId = id.normalize();
final String localValue = value.trim();
idMap.put(localId, localValue);
}
} | [
"public",
"void",
"addId",
"(",
"final",
"URI",
"id",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
"&&",
"value",
"!=",
"null",
")",
"{",
"final",
"URI",
"localId",
"=",
"id",
".",
"normalize",
"(",
")",
";",
"final",
... | Add topic id-value pairs to idMap.
@param id id
@param value value | [
"Add",
"topic",
"id",
"-",
"value",
"pairs",
"to",
"idMap",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L88-L94 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.getIdValue | public String getIdValue(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
return idMap.get(localId);
} | java | public String getIdValue(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
return idMap.get(localId);
} | [
"public",
"String",
"getIdValue",
"(",
"final",
"URI",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URI",
"localId",
"=",
"id",
".",
"normalize",
"(",
")",
";",
"return",
"idMap",
".",
"get",
"(",
... | Return the value corresponding to the id.
@param id id
@return value | [
"Return",
"the",
"value",
"corresponding",
"to",
"the",
"id",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L101-L107 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.isVisited | public boolean isVisited(final URI path) {
final URI localPath = stripFragment(path).normalize();
return visitSet.contains(localPath);
} | java | public boolean isVisited(final URI path) {
final URI localPath = stripFragment(path).normalize();
return visitSet.contains(localPath);
} | [
"public",
"boolean",
"isVisited",
"(",
"final",
"URI",
"path",
")",
"{",
"final",
"URI",
"localPath",
"=",
"stripFragment",
"(",
"path",
")",
".",
"normalize",
"(",
")",
";",
"return",
"visitSet",
".",
"contains",
"(",
"localPath",
")",
";",
"}"
] | Return if this path has been visited before.
@param path topic path, may contain a fragment
@return true if has been visited | [
"Return",
"if",
"this",
"path",
"has",
"been",
"visited",
"before",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L114-L117 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.visit | public void visit(final URI path) {
final URI localPath = stripFragment(path).normalize();
visitSet.add(localPath);
} | java | public void visit(final URI path) {
final URI localPath = stripFragment(path).normalize();
visitSet.add(localPath);
} | [
"public",
"void",
"visit",
"(",
"final",
"URI",
"path",
")",
"{",
"final",
"URI",
"localPath",
"=",
"stripFragment",
"(",
"path",
")",
".",
"normalize",
"(",
")",
";",
"visitSet",
".",
"add",
"(",
"localPath",
")",
";",
"}"
] | Add topic to set of visited topics.
@param path topic path, may contain a fragment | [
"Add",
"topic",
"to",
"set",
"of",
"visited",
"topics",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L124-L127 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.getFirstTopicId | public String getFirstTopicId(final URI file, final boolean useCatalog) {
assert file.isAbsolute();
if (!(new File(file).exists())) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
... | java | public String getFirstTopicId(final URI file, final boolean useCatalog) {
assert file.isAbsolute();
if (!(new File(file).exists())) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
... | [
"public",
"String",
"getFirstTopicId",
"(",
"final",
"URI",
"file",
",",
"final",
"boolean",
"useCatalog",
")",
"{",
"assert",
"file",
".",
"isAbsolute",
"(",
")",
";",
"if",
"(",
"!",
"(",
"new",
"File",
"(",
"file",
")",
".",
"exists",
"(",
")",
")... | Get the first topic id.
@param file file URI
@param useCatalog whether use catalog file for validation
@return topic id | [
"Get",
"the",
"first",
"topic",
"id",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L136-L154 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/DitaIndexWriter.java | DitaIndexWriter.checkMatch | private boolean checkMatch() {
if (matchList == null) {
return true;
}
final int matchSize = matchList.size();
final int ancestorSize = topicIdList.size();
final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
return matchList.... | java | private boolean checkMatch() {
if (matchList == null) {
return true;
}
final int matchSize = matchList.size();
final int ancestorSize = topicIdList.size();
final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
return matchList.... | [
"private",
"boolean",
"checkMatch",
"(",
")",
"{",
"if",
"(",
"matchList",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"int",
"matchSize",
"=",
"matchList",
".",
"size",
"(",
")",
";",
"final",
"int",
"ancestorSize",
"=",
"topicIdList",
... | check whether the hierarchy of current node match the matchList | [
"check",
"whether",
"the",
"hierarchy",
"of",
"current",
"node",
"match",
"the",
"matchList"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/DitaIndexWriter.java#L95-L103 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/DitaIndexWriter.java | DitaIndexWriter.writeStartElement | private void writeStartElement(final String qName, final Attributes atts) throws IOException {
final int attsLen = atts.getLength();
output.write(LESS_THAN + qName);
for (int i = 0; i < attsLen; i++) {
final String attQName = atts.getQName(i);
final String attValue = esca... | java | private void writeStartElement(final String qName, final Attributes atts) throws IOException {
final int attsLen = atts.getLength();
output.write(LESS_THAN + qName);
for (int i = 0; i < attsLen; i++) {
final String attQName = atts.getQName(i);
final String attValue = esca... | [
"private",
"void",
"writeStartElement",
"(",
"final",
"String",
"qName",
",",
"final",
"Attributes",
"atts",
")",
"throws",
"IOException",
"{",
"final",
"int",
"attsLen",
"=",
"atts",
".",
"getLength",
"(",
")",
";",
"output",
".",
"write",
"(",
"LESS_THAN",... | SAX serializer methods | [
"SAX",
"serializer",
"methods"
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/DitaIndexWriter.java#L339-L348 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.readExtensions | private String readExtensions(final String featureName) {
final Set<String> exts = new HashSet<>();
if (featureTable.containsKey(featureName)) {
for (final Value ext : featureTable.get(featureName)) {
final String e = ext.value.trim();
if (e.length() != 0) {
... | java | private String readExtensions(final String featureName) {
final Set<String> exts = new HashSet<>();
if (featureTable.containsKey(featureName)) {
for (final Value ext : featureTable.get(featureName)) {
final String e = ext.value.trim();
if (e.length() != 0) {
... | [
"private",
"String",
"readExtensions",
"(",
"final",
"String",
"featureName",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"exts",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"featureTable",
".",
"containsKey",
"(",
"featureName",
")",
")",
"... | Read plug-in feature.
@param featureName plug-in feature name
@return combined list of values | [
"Read",
"plug",
"-",
"in",
"feature",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L678-L689 | train |
dita-ot/dita-ot | src/main/java/org/dita/dost/platform/Integrator.java | Integrator.loadPlugin | private boolean loadPlugin(final String plugin) {
if (checkPlugin(plugin)) {
final Features pluginFeatures = pluginTable.get(plugin);
final Map<String, List<String>> featureSet = pluginFeatures.getAllFeatures();
for (final Map.Entry<String, List<String>> currentFeature : feat... | java | private boolean loadPlugin(final String plugin) {
if (checkPlugin(plugin)) {
final Features pluginFeatures = pluginTable.get(plugin);
final Map<String, List<String>> featureSet = pluginFeatures.getAllFeatures();
for (final Map.Entry<String, List<String>> currentFeature : feat... | [
"private",
"boolean",
"loadPlugin",
"(",
"final",
"String",
"plugin",
")",
"{",
"if",
"(",
"checkPlugin",
"(",
"plugin",
")",
")",
"{",
"final",
"Features",
"pluginFeatures",
"=",
"pluginTable",
".",
"get",
"(",
"plugin",
")",
";",
"final",
"Map",
"<",
"... | Load the plug-ins and aggregate them by feature and fill into feature
table.
@param plugin plugin ID
@return {@code true}> if plugin was loaded, otherwise {@code false} | [
"Load",
"the",
"plug",
"-",
"ins",
"and",
"aggregate",
"them",
"by",
"feature",
"and",
"fill",
"into",
"feature",
"table",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/platform/Integrator.java#L698-L734 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.