code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
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 |
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 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 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 |
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 |
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 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 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 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 |
public void setCurrentFile(final URI currentFile) {
assert currentFile.isAbsolute();
super.setCurrentFile(currentFile);
currentDir = currentFile.resolve(".");
} | 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)) {
... | 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... | 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... | 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("..... | 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());
... | 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... | 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;
} | 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());
... | 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... | 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... | 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 {
... | 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());
... | 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... | 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(... | 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 = ... | java |
private void onStartElement(QName name, XMLAttributes atts) {
if (detecting) {
detecting = false;
loadDefaults();
}
if (defaults != null) {
checkAndAddDefaults(name, atts);
}
} | java |
private boolean nullOrValue(String test, String value) {
if (test == null)
return true;
if (test.equals(value))
return true;
return false;
} | 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) == '\'') ... | 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) == '#') {
... | 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... | java |
@Override
public void write(final File filename) throws DITAOTException {
assert filename.isAbsolute();
super.write(new File(currentFile));
} | 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... | 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... | 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... | 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 (... | 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);
} | 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... | 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... | 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... | 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... | 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... | 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... | 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... | 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;
}
}
... | 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());... | 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... | 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... | 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);
... | java |
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 extractProjectName(final BuildEvent event) {
final Project project = event.getProject();
return (project != null) ? project.getName() : null;
} | 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;
} | 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);
... | 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... | 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;
} | 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);
}
} | 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 ... | 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... | 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);
} | 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... | 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;
} | java |
public Set<URI> getNonTopicrefReferenceSet() {
final Set<URI> res = new HashSet<>(nonTopicrefReferenceSet);
res.removeAll(normalProcessingRoleSet);
res.removeAll(resourceOnlySet);
return res;
} | 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 (... | java |
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 static boolean canFollow(URI href) {
if (href != null && href.getScheme() != null && href.getScheme().equals("mailto")) {
return false;
}
return true;
} | java |
private boolean isOutFile(final URI toCheckPath) {
final String path = toCheckPath.getPath();
return !(path != null && path.startsWith(rootDir.getPath()));
} | 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... | 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.... | java |
public List<Attribute> getDefaultAttributes(String localName, String namespace) {
if (defaultValuesCollector != null) {
return defaultValuesCollector.getDefaultAttributes(localName, namespace);
}
return null;
} | 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);
... | 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... | 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 ... | 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... | 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);
} | java |
public static void start(final String[] args, final Properties additionalUserProperties,
final ClassLoader coreLoader) {
final Main m = new Main();
m.startAnt(args, additionalUserProperties, coreLoader);
} | java |
private void handleLogfile() {
if (args.logFile != null) {
FileUtils.close(out);
FileUtils.close(err);
}
} | 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);
... | 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... | 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) {... | 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... | 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");
... | 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... | 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);
... | 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 ... | 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 ... | 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... | 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 ... | 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... | java |
public void setValidateMap(final Map<QName, Map<String, Set<String>>> validateMap) {
this.validateMap = validateMap;
} | 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<... | 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].... | 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;
} | 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);
}
} | java |
public String getIdValue(final URI id) {
if (id == null) {
return null;
}
final URI localId = id.normalize();
return idMap.get(localId);
} | java |
public boolean isVisited(final URI path) {
final URI localPath = stripFragment(path).normalize();
return visitSet.contains(localPath);
} | java |
public void visit(final URI path) {
final URI localPath = stripFragment(path).normalize();
visitSet.add(localPath);
} | 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);
... | 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.... | 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... | 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) {
... | 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... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.