public String getAttributeName(int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
/** * This returns a <code>String</code> representation of the * <code>Attribute</code>, suitable for debugging. * * @return <code>String</code> - information about the * <code>Attribute</code> */ @Override public String toString() { return new StringBuilder() .append("[Attribute: ") .append(getQualifiedName()) .append("=\"") .append(value) .append("\"") .append("]") .toString(); }
/** * This will create an <code>Exception</code> indicating * that the addition of the <code>{@link Attribute}</code> * to the <code>{@link Element}</code> is illegal. * * @param base <code>Element</code> that <code>Attribute</code> * couldn't be added to * @param added <code>Attribute</code> that could not be added * @param reason cause of the problem */ IllegalAddException(Element base, Attribute added, String reason) { super(new StringBuilder() .append("The attribute \"") .append(added.getQualifiedName()) .append("\" could not be added to the element \"") .append(base.getQualifiedName()) .append("\": ") .append(reason) .toString()); }
/** * This will handle printing of a {@link Attribute}. * * @param fstack * the FormatStack * @param basedoc * The org.w3c.dom.Document for creating DOM Nodes * @param attribute * <code>Attribute</code> to write. * @return The input JDOM Attribute converted to a DOM Attr */ protected org.w3c.dom.Attr printAttribute(final FormatStack fstack, final org.w3c.dom.Document basedoc, final Attribute attribute) { if (!attribute.isSpecified() && fstack.isSpecifiedAttributesOnly()) { return null; } org.w3c.dom.Attr attr = basedoc.createAttributeNS( attribute.getNamespaceURI(), attribute.getQualifiedName()); attr.setValue(attribute.getValue()); return attr; }
/** * This will handle printing of an <code>{@link Attribute}</code>. * * @param out * <code>Writer</code> to use. * @param fstack * The current FormatStack * @param attribute * <code>Attribute</code> to output * @throws IOException * if the output fails */ protected void printAttribute(final Writer out, final FormatStack fstack, final Attribute attribute) throws IOException { if (!attribute.isSpecified() && fstack.isSpecifiedAttributesOnly()) { return; } write(out, " "); write(out, attribute.getQualifiedName()); write(out, "="); write(out, "\""); attributeEscapedEntitiesFilter(out, fstack, attribute.getValue()); write(out, "\""); }
a.getQualifiedName(), getAttributeTypeName(a.getAttributeType()), a.getValue());
@Override public String getAttributeName(final int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
public String getAttributeName(int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
public String getAttributeName(int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
public String getAttributeName(int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
public String getAttributeName(int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
/** * Adds attributes from in element to out element. * * @param out out element * @param in in element */ private void addAttributes(Element out, Element in) { LinkedHashMap<String, Attribute> allAttributes = new LinkedHashMap<String, Attribute>(); List<Attribute> outAttributes = new ArrayList<Attribute>(out.getAttributes()); List<Attribute> inAttributes = new ArrayList<Attribute>(in.getAttributes()); for (Attribute attr : outAttributes) { attr.detach(); allAttributes.put(attr.getQualifiedName(), attr); logger.fine("adding attr from out:" + attr); } for (Attribute attr : inAttributes) { attr.detach(); allAttributes.put(attr.getQualifiedName(), attr); logger.fine("adding attr from in:" + attr); } out.setAttributes(new ArrayList<Attribute>(allAttributes.values())); }
/** * Adds attributes from in element to out element. * * @param out out element * @param in in element */ private void addAttributes(Element out, Element in) { LinkedHashMap<String, Attribute> allAttributes = new LinkedHashMap<String, Attribute>(); List<Attribute> outAttributes = new ArrayList<Attribute>(out.getAttributes()); List<Attribute> inAttributes = new ArrayList<Attribute>(in.getAttributes()); for (Attribute attr : outAttributes) { attr.detach(); allAttributes.put(attr.getQualifiedName(), attr); logger.fine("adding attr from out:" + attr); } for (Attribute attr : inAttributes) { attr.detach(); allAttributes.put(attr.getQualifiedName(), attr); logger.fine("adding attr from in:" + attr); } out.setAttributes(new ArrayList<Attribute>(allAttributes.values())); }
equalsString(origAttribute.getQualifiedName(), getAttributeName(), ignoreCaseAttributeName()))) if (origAttribute.getQualifiedName().equalsIgnoreCase(patchAttribute.getQualifiedName())) if (origAttribute.getQualifiedName().equals(patchAttribute.getQualifiedName()))
for (Attribute attribute : attributes) { boolean excluded = false; if (exclude(attribute.getQualifiedName(), this.excludeProperties)) { if (isRepositoryUserGroup && StringUtils.equals(attribute.getQualifiedName(), JcrConstants.JCR_UUID)) { else if (StringUtils.equals(attribute.getQualifiedName(), PRIMARYTYPE_PROPERTY)) { String namespacePrefix = StringUtils.substringBefore(attribute.getValue(), ":"); collectNamespacePrefix(namespacePrefixesActuallyUsed, namespacePrefix); else if (StringUtils.equals(attribute.getQualifiedName(), MIXINS_PROPERTY)) { String filteredValue = filterMixinsPropertyValue(attribute.getValue(), namespacePrefixesActuallyUsed); if (StringUtils.isBlank(filteredValue)) { collectNamespacePrefixNameArray(namespacePrefixesActuallyUsed, attribute.getQualifiedName(), attribute.getValue()); attribute.setValue(sortWeakReferenceValues(attribute.getQualifiedName(), attribute.getValue()));
private void printAttribute(Writer out, FormatStack fstack, Attribute attribute, boolean printMultiLine) throws IOException { if (!attribute.isSpecified() && fstack.isSpecifiedAttributesOnly()) { return; } if (printMultiLine) { write(out, StringUtils.defaultString(fstack.getLineSeparator())); write(out, StringUtils.defaultString(fstack.getLevelIndent())); write(out, StringUtils.defaultString(fstack.getIndent())); } else { write(out, " "); } write(out, attribute.getQualifiedName()); write(out, "="); write(out, "\""); attributeEscapedEntitiesFilter(out, fstack, attribute.getValue()); write(out, "\""); }