/** * Create a whitespace attribute with the value given. * @param value The value of this attribute. * @exception IllegalArgumentException if the value contains other than * whitespace. To set a real value use {@link #Attribute(String,String)}. */ public Attribute (String value) throws IllegalArgumentException { if (0 != value.trim ().length ()) throw new IllegalArgumentException ("non whitespace value"); else { setName (null); setAssignment (null); setValue (value); setQuote ((char)0); } }
/** * Create a whitespace attribute with the value given. * @param value The value of this attribute. * @exception IllegalArgumentException if the value contains other than * whitespace. To set a real value use {@link #Attribute(String,String)}. */ public Attribute (String value) throws IllegalArgumentException { if (0 != value.trim ().length ()) throw new IllegalArgumentException ("non whitespace value"); else { setName (null); setAssignment (null); setValue (value); setQuote ((char)0); } }
/** * Create an attribute. * @param page The page containing the attribute. * @param name_start The starting offset of the name within the page. * If this is negative, the name is considered null. * @param name_end The ending offset of the name within the page. * @param value_start he starting offset of the value within the page. * If this is negative, the value is considered null. * @param value_end The ending offset of the value within the page. * @param quote The quote, if any, surrounding the value of the attribute, * (i.e. ' or "), or zero if none. */ public PageAttribute (Page page, int name_start, int name_end, int value_start, int value_end, char quote) { mPage = page; mNameStart = name_start; mNameEnd = name_end; mValueStart = value_start; mValueEnd = value_end; setName (null); setAssignment (null); setValue (null); setQuote (quote); }
/** * Create an attribute with the name, assignment, value and quote given. * If the quote value is zero, assigns the value using {@link #setRawValue} * which sets the quote character to a proper value if necessary. * @param name The name of this attribute. * @param assignment The assignment string of this attribute. * @param value The value of this attribute. * @param quote The quote around the value of this attribute. */ public Attribute (String name, String assignment, String value, char quote) { setName (name); setAssignment (assignment); if (0 == quote) setRawValue (value); else { setValue (value); setQuote (quote); } }
/** * Create an attribute with the name, assignment, value and quote given. * If the quote value is zero, assigns the value using {@link #setRawValue} * which sets the quote character to a proper value if necessary. * @param name The name of this attribute. * @param assignment The assignment string of this attribute. * @param value The value of this attribute. * @param quote The quote around the value of this attribute. */ public Attribute (String name, String assignment, String value, char quote) { setName (name); setAssignment (assignment); if (0 == quote) setRawValue (value); else { setValue (value); setQuote (quote); } }
attribute.setQuote (quote);
attribute.setQuote (quote);