/** * Get the raw value of the attribute. * The part after the equals sign, or the text if it's just a whitepace * 'attribute'. This includes the quotes around the value if any. * @param buffer The string buffer to append the attribute value to. * @see #getRawValue() */ public void getRawValue (StringBuilder buffer) { getQuote (buffer); getValue (buffer); getQuote (buffer); }
/** * Get the raw value of the attribute. * The part after the equals sign, or the text if it's just a whitepace * 'attribute'. This includes the quotes around the value if any. * @param buffer The string buffer to append the attribute value to. * @see #getRawValue() * @see #setRawValue */ public void getRawValue (StringBuffer buffer) { getQuote (buffer); getValue (buffer); getQuote (buffer); }
/** * Get the raw value of the attribute. * The part after the equals sign, or the text if it's just a whitepace * 'attribute'. This includes the quotes around the value if any. * @return The value, or <code>null</code> if it's a stand-alone attribute, * or the text if it's just a whitepace 'attribute'. */ public String getRawValue () { char quote; StringBuffer buffer; String ret; ret = getValue (); if (null != ret && (0 != (quote = getQuote ()))) { buffer = new StringBuffer (ret.length() + 2); buffer.append (quote); buffer.append (ret); buffer.append (quote); ret = buffer.toString (); } return (ret); }
private static Vector cloneAttributes(Vector<Attribute> attributes) { Vector<Attribute> newAttributes = new Vector<>(attributes.size()); for (Attribute a : attributes) { newAttributes.add(new Attribute(a.getName(), a.getAssignment(), a.getValue(), a.getQuote())); } return newAttributes; }
private static Vector cloneAttributes(Vector<Attribute> attributes) { Vector<Attribute> newAttributes = new Vector<>(attributes.size()); for (Attribute a : attributes) { newAttributes.add(new Attribute(a.getName(), a.getAssignment(), a.getValue(), a.getQuote())); } return newAttributes; }
quote = getQuote (); if (0 != quote)
/** * Get the raw value of the attribute. * The part after the equals sign, or the text if it's just a whitepace * 'attribute'. This includes the quotes around the value if any. * @return The value, or <code>null</code> if it's a stand-alone attribute, * or the text if it's just a whitepace 'attribute'. */ public String getRawValue () { char quote; StringBuilder buffer; String ret; if (isValued ()) { quote = getQuote (); if (0 != quote) { buffer = new StringBuilder (); // todo: what is the value length? buffer.append (quote); getValue (buffer); buffer.append (quote); ret = buffer.toString (); } else ret = getValue (); } else ret = null; return (ret); }
/** * Get the length of the string value of this attribute. * @return The number of characters required to express this attribute. */ public int getLength () { String name; String assignment; String value; char quote; int ret; ret = 0; name = getName (); if (null != name) ret += name.length (); assignment = getAssignment (); if (null != assignment) ret += assignment.length (); value = getValue (); if (null != value) ret += value.length (); quote = getQuote (); if (0 != quote) ret += 2; return (ret); }
/** * Get the length of the string value of this attribute. * @return The number of characters required to express this attribute. */ public int getLength () { String name; String assignment; String value; char quote; int ret; ret = 0; name = getName (); if (null != name) ret += name.length (); assignment = getAssignment (); if (null != assignment) ret += assignment.length (); value = getValue (); if (null != value) ret += value.length (); quote = getQuote (); if (0 != quote) ret += 2; return (ret); }
else if ((null != mPage) && (0 <= mValueStart) && (0 <= mValueEnd)) ret += mValueEnd - mValueStart; quote = getQuote (); if (0 != quote) ret += 2;
if ((null == zeroth.getValue ()) && (0 == zeroth.getQuote ())) attributes.set(0,attribute); else
if ((null == zeroth.getValue ()) && (0 == zeroth.getQuote ())) attributes.setElementAt (attribute, 0); else
length++; if ((null != attribute.getValue ()) && (0 == attribute.getQuote ())) attributes.insertElementAt (new Attribute (" "), length - 1); replaced = true;