@NotNull @Override public SdkProperties loadProperties(@Nullable Element propertiesElement) { String erlangSdkName = null; if (propertiesElement != null) { @Nullable Attribute erlangSdkNameAttribute = propertiesElement.getAttribute("erlang-sdk-name"); if (erlangSdkNameAttribute != null) { erlangSdkName = erlangSdkNameAttribute.getValue(); } } return new SdkProperties(erlangSdkName); }
result.addAll(e.getAttributes()); } else { Attribute attr = e.getAttribute(localName, Namespace.getNamespace("", namespaceUri)); if (attr != null) { result.add(attr);
/** * Retrieves an <code>Iterator</code> over the attribute elements that * match the supplied name. * * @param contextNode the origin context node * @param localName the local name of the attributes to return, always present * @param namespacePrefix the prefix of the namespace of the attributes to return * @param namespaceURI the URI of the namespace of the attributes to return * @return an Iterator that traverses the named attributes, not null */ public Iterator getAttributeAxisIterator( Object contextNode, String localName, String namespacePrefix, String namespaceURI) { if ( contextNode instanceof Element ) { Element node = (Element) contextNode; Namespace namespace = (namespaceURI == null ? Namespace.NO_NAMESPACE : Namespace.getNamespace(namespacePrefix, namespaceURI)); Attribute attr = node.getAttribute(localName, namespace); if (attr != null) { return new SingleObjectIterator(attr); } } return JaxenConstants.EMPTY_ITERATOR; }
dayOnRequest.setWeight(element.getAttribute("weight").getIntValue());
dayOffRequest.setWeight(element.getAttribute("weight").getIntValue());
shiftOnRequest.setWeight(element.getAttribute("weight").getIntValue());
shiftOffRequest.setWeight(element.getAttribute("weight").getIntValue());
Employee employee = new Employee(); employee.setId(id); employee.setCode(element.getAttribute("ID").getValue()); employee.setName(element.getChild("Name").getText()); Element contractElement = element.getChild("ContractID");
NurseRoster nurseRoster = new NurseRoster(); nurseRoster.setId(0L); nurseRoster.setCode(schedulingPeriodElement.getAttribute("ID").getValue());
int weight; if (enabled) { weight = element.getAttribute("weight").getIntValue(); if (weight < 0) { throw new IllegalArgumentException("The weight (" + weight
if (node instanceof Element) { Element element = (Element) node; attr = element.getAttribute(localName, namespace); } else if (node instanceof ProcessingInstruction) { ProcessingInstruction pi = (ProcessingInstruction) node;
Element minElement, Element maxElement, ContractLineType contractLineType) throws DataConversionException { boolean minimumEnabled = minElement == null ? false : minElement.getAttribute("on").getBooleanValue(); int minimumWeight; if (minimumEnabled) { minimumWeight = minElement.getAttribute("weight").getIntValue(); if (minimumWeight < 0) { throw new IllegalArgumentException("The minimumWeight (" + minimumWeight minimumWeight = 0; boolean maximumEnabled = maxElement == null ? false : maxElement.getAttribute("on").getBooleanValue(); int maximumWeight; if (maximumEnabled) { maximumWeight = maxElement.getAttribute("weight").getIntValue(); if (maximumWeight < 0) { throw new IllegalArgumentException("The maximumWeight (" + maximumWeight
ShiftType shiftType = new ShiftType(); shiftType.setId(id); shiftType.setCode(element.getAttribute("ID").getValue()); shiftType.setIndex(index); String startTimeString = element.getChild("StartTime").getText();
Contract contract = new Contract(); contract.setId(id); contract.setCode(element.getAttribute("ID").getValue()); contract.setDescription(element.getChild("Description").getText());
for (Element element : patternElementList) { assertElementName(element, "Pattern"); String code = element.getAttribute("ID").getValue(); int weight = element.getAttribute("weight").getIntValue();
zoneReplicationFactor = new HashMap<Integer, Integer>(); for(Element node: (List<Element>) zoneReplicationFactorNode.getChildren(STORE_REPLICATION_FACTOR_ELMT)) { int zone = Integer.parseInt(node.getAttribute(STORE_ZONE_ID_ELMT).getValue()); int repFactor = Integer.parseInt(node.getText()); zoneReplicationFactor.put(zone, repFactor);
protected Attribute getAttribute(Element e, String attributeName) { Attribute attribute = e.getAttribute(attributeName); if (attribute == null) { attribute = e.getAttribute(attributeName, _namespace); } return attribute; }
public void cleanImport(Element node) { Attribute schemaLoc = node.getAttribute("schemaLocation"); // TODO: How do we make sure this is imported??? if (schemaLoc != null) schemaLoc.detach(); }
public static Map<String, Element> mapByAttributeName(List<Element> elements, String attrName) { LinkedHashMap<String, Element> rc = new LinkedHashMap<String, Element>(); for (Element element : elements) { Attribute attribute = element.getAttribute(attrName); if (attribute != null) { rc.put(attribute.getValue(), element); } } return rc; }
private void updateJournalZblFingerprint(org.jdom.Element jmeta, YElement journal) { // Try to update journal with zbl fingerprint try { org.jdom.Element jtitles = JDOMHelper.getChild(jmeta, "journal-title-group"); String journalAbbrev = JDOMHelper.getChildTextTrim(jtitles, "abbrev-journal-title"); String abrevType = JDOMHelper.getChild(jtitles, "abbrev-journal-title").getAttribute("abbrev-type").getValue().trim(); if ("short-title".equals(abrevType)) { journal.addAttribute(ZentrallBlatSpecificAttributeTypes.AT_ZBL_JOURNAL_FINGERPRINT, journalAbbrev); } } catch (Exception e) { } }