public String[] getChildrenPropertiesValues(String parent) { String[] propName = parsePropertyName(parent); // Search for this property by traversing down the XML heirarchy. Element element = doc.getRootElement(); for (int i = 0; i < propName.length; i++) { element = element.getChild(propName[i]); if (element == null) { // This node doesn't match this part of the property name which // indicates this property doesn't exist so return empty array. return new String[] {}; } } // We found matching property, return names of children. List children = element.getChildren(); int childCount = children.size(); String[] childrenNames = new String[childCount]; for (int i = 0; i < childCount; i++) { childrenNames[i] = ((Element) children.get(i)).getValue(); } return childrenNames; }
private String getValue(Element element) { if (element != null) { return element.getValue(); } return null; }
protected String getChildValue(Element element, String localName, Namespace ns) { Element child = element.getChild(localName, ns); if (child == null) return null; return child.getValue(); }
/** * @param artifactElement * a nexus jdom xml artifact element */ public Artifact(Element artifactElement) { groupId = artifactElement.getChild("groupId").getValue(); artifactId = artifactElement.getChild("artifactId").getValue(); version = artifactElement.getChild("version").getValue(); classifier = artifactElement.getChild("classifier").getValue(); packaging = artifactElement.getChild("packaging").getValue(); repoId = artifactElement.getChild("repoId").getValue(); }
@SuppressWarnings("unchecked") private static String getSubelementValue(Element inElement, String attributeValue) { String rueckgabe = ""; for (Iterator<Element> iter = inElement.getChildren().iterator(); iter.hasNext();) { Element subElement = iter.next(); if (subElement.getAttributeValue("code").equals(attributeValue)) { rueckgabe = subElement.getValue(); } } return rueckgabe; }
@Override public String call() throws Exception { return doExecute(host, dirLocation, commandElement.getValue(), argsF, ignoreOutput, action, recoveryId, preserveF); } });
@Override public String call() throws Exception { return doExecute(host, dirLocation, commandElement.getValue(), argsF, ignoreOutput, action, recoveryId, preserveF); } });
protected static QName elementToQName(Element el) { String value = el.getValue(); return stringToQName(el, value); }
private String getValue(Element element, String child) { if (element != null) { Element childElement = element.getChild(child, Namespace.getNamespace(NAMESPACE)); if (childElement != null) { return childElement.getValue(); } } return null; }
public String getAddress() { return getAddressElement().getValue(); }
public String getSuggestedTileSize() { Element el = getParameter(SUGGESTED_TILE_SIZEFilter); if (el != null) { List<Element> values = el.getChildren(); for (Element elm : values) { String value = elm.getValue(); if (!value.equalsIgnoreCase(SUGGESTED_TILE_SIZE)) { return value; } } } return null; }
private void appendMultivalueBuiltinColumn(Element itemElement, String columnName, StringBuilder jsonIssueElementBuilder) { jsonIssueElementBuilder.append("'"); jsonIssueElementBuilder.append(StringEscapeUtils.escapeJavaScript(xmlXformer.collapseMultiple(itemElement, columnName).getValue())); jsonIssueElementBuilder.append("'"); }
public AbstractRegexConstraint(Element e) { super(e); List<?> termElements = e.getChildren("term"); if (termElements.size() == 0) { throw new IllegalArgumentException("No terms specified for element: " + e.toString()); } List<String> terms = new ArrayList<String>(termElements.size()); for (Object term : termElements) { terms.add(((Element)term).getValue().toLowerCase()); } this.pattern = buildPattern(terms); this.terms = new ArraySet<String>(terms); }
private void parsePmdPriority(Element eltRule, PmdRule pmdRule, @Nullable Namespace namespace) { for (Element eltPriority : getChildren(eltRule, "priority", namespace)) { pmdRule.setPriority(Integer.valueOf(eltPriority.getValue())); } }
private static void parsePmdPriority(Element eltRule, PmdRule pmdRule, @Nullable Namespace namespace) { for (Element eltPriority : getChildren(eltRule, "priority", namespace)) { pmdRule.setPriority(eltPriority.getValue()); } } }
private void parsePmdPriority(Element eltRule, PmdRule pmdRule, @Nullable Namespace namespace) { for (Element eltPriority : getChildren(eltRule, "priority", namespace)) { pmdRule.setPriority(eltPriority.getValue()); } } }
private void updateJournalIssns(org.jdom.Element jmeta, YElement journal) { // journal.addId(y.id(EXT_SCHEME_ISSN, jmeta.getChildTextTrim("issn"))); List<org.jdom.Element> issns = JDOMHelper.getChildren(jmeta, "issn"); for (org.jdom.Element issn : issns) { String issnValue = issn.getValue().trim(); // System.out.println("[NlmToYTransformer] Adding next issn:" + // issnValue); if (StringUtils.isNotBlank(issnValue)) { journal.addId(new YId(EXT_SCHEME_ISSN, issnValue)); } } }
protected final void parsePmdPriority(Element ruleNode, PmdRule pmdRule, Namespace namespace) { for (Element priorityNode : getChildren(ruleNode, "priority", namespace)) { pmdRule.setPriority(priorityNode.getValue()); } }
/** * Returns the trimmed text value of an element with MathML descendants removed. * * @param e the element to get the text value from * @return the text value of the element after removal of MathML descendants and whitespace trimming */ private String noMathMLValue(Element e) { return zapNamespace((Element) e.clone(), Namespace.getNamespace("http://www.w3.org/1998/Math/MathML")).getValue().trim(); }
public void set(final String key, final List<Element> value) { // if some previous similar object is found final Element search; if ((search = ElementUtils.contains(getRoot(), new NestedElementFilter( getRoot(), key, value.get(0).getValue()))) != null) { // remove it ElementUtils.remove(search, search); } // add the new entry add(key, value); }