|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.AbstractXmlObject
com.waveset.object.WSAttribute
WSAttribute class used as a generic attribute class. Also used as a base class for attributes that need to carry around additional information (e.g. ResourceAttribute class)
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
ELEMENT
|
static java.lang.String |
TRUNCATION_STRING
|
Fields inherited from class com.waveset.util.AbstractXmlObject |
_trace |
Constructor Summary | |
WSAttribute()
|
|
WSAttribute(Attribute attribute)
|
|
WSAttribute(Attribute attribute,
AttributeValues value)
|
|
WSAttribute(Attribute attribute,
java.lang.Object attrVal)
|
|
WSAttribute(AttributeValues value,
java.lang.String name,
java.lang.String type)
|
|
WSAttribute(AttributeValues value,
java.lang.String name,
Syntax syntax)
|
|
WSAttribute(org.w3c.dom.Element e)
|
|
WSAttribute(java.lang.String name)
|
|
WSAttribute(java.lang.String name,
java.lang.Object attrVal)
|
|
WSAttribute(java.lang.String name,
java.lang.Object attrVal,
java.lang.String type)
|
|
WSAttribute(java.lang.String name,
java.lang.Object attrVal,
Syntax syntax)
|
|
WSAttribute(WSAttribute src)
|
Method Summary | |
boolean |
add(java.lang.Object attrVal)
Adds a value if this attribute does not already contain the value, or if this attribute is ordered. |
boolean |
add(java.lang.Object attrVal,
int limit,
java.lang.String truncationString)
Adds a value if this attribute does not already contain the value, or if this attribute is ordered. |
void |
clear()
|
boolean |
contains(java.lang.Object attrVal)
|
boolean |
containsIgnoreCase(java.lang.Object attrVal)
|
java.lang.Object |
get()
|
java.lang.Object |
get(int n)
|
java.lang.Object[] |
getAll()
|
AttributeValues |
getAttrValues()
|
java.lang.String |
getElementName()
Return the element name. |
java.lang.String |
getID()
|
boolean |
getMultiValued()
|
java.lang.String |
getName()
|
java.lang.Object |
getStandardValue()
|
java.lang.String |
getType()
|
java.lang.Object |
getValue()
|
java.lang.Object |
getValue(int n)
|
java.lang.String |
getValueAsString()
|
java.lang.String |
getValueAsString(int n)
|
boolean |
isOrdered()
|
static void |
main(java.lang.String[] args)
|
void |
parseXml(org.w3c.dom.Element e)
Assumes that the element is an Attribute. |
void |
parseXml(java.lang.String xml)
Looks for the first instance of an Attribute element in the XML string and parse it. |
boolean |
put(java.lang.Object attrVal)
Adds a value if this attribute does not already contain the value. |
void |
setIsOrdered(boolean ord)
|
void |
setName(java.lang.String name)
|
void |
setSyntax(Syntax syntax)
|
void |
setType(java.lang.String type)
|
void |
setValue(int n,
java.lang.Object attrVal)
Replaces a specified value with the value passed in. |
void |
setValue(java.lang.Object attrVal)
Replaces the attribute's values with the value passed in. |
void |
setValues(java.util.List attrVals)
Replaces the attribute's values with the values passed in. |
void |
setValues(java.lang.Object[] attrVals)
Replaces the attribute's values with the values passed in. |
int |
size()
|
java.lang.String |
toString()
|
java.lang.String |
toXml()
Returns the string buffer built by toXml(StringBuffer) as a String. |
void |
toXml(java.lang.StringBuffer buf)
This isn't defined in the XmlObject interface, but its used a lot in older code, so provide an implementation to ease the transition. |
void |
toXml(java.lang.StringBuffer buf,
int indent)
Writes the attribute to XML in one of the following formats: |
int |
truncate(int limit)
Limit the number of values that this WSAttribute contains. |
int |
truncate(int limit,
java.lang.String truncationString)
Limit the number of values that this WSAttribute contains. |
Methods inherited from class com.waveset.util.AbstractXmlObject |
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String ELEMENT
public static final java.lang.String TRUNCATION_STRING
Constructor Detail |
public WSAttribute()
public WSAttribute(org.w3c.dom.Element e) throws WavesetException
public WSAttribute(java.lang.String name)
public WSAttribute(java.lang.String name, java.lang.Object attrVal)
public WSAttribute(java.lang.String name, java.lang.Object attrVal, Syntax syntax)
public WSAttribute(AttributeValues value, java.lang.String name, Syntax syntax)
public WSAttribute(AttributeValues value, java.lang.String name, java.lang.String type)
public WSAttribute(java.lang.String name, java.lang.Object attrVal, java.lang.String type)
public WSAttribute(Attribute attribute)
public WSAttribute(Attribute attribute, java.lang.Object attrVal)
public WSAttribute(Attribute attribute, AttributeValues value)
public WSAttribute(WSAttribute src)
Method Detail |
public java.lang.String getElementName()
AbstractXmlObject
getElementName
in interface XmlObject
getElementName
in class AbstractXmlObject
public boolean contains(java.lang.Object attrVal)
public boolean containsIgnoreCase(java.lang.Object attrVal)
public boolean put(java.lang.Object attrVal)
public boolean add(java.lang.Object attrVal)
isOrdered()
public boolean add(java.lang.Object attrVal, int limit, java.lang.String truncationString)
Will limit the number of attributes and append the truncation string if at the limit. If there are six elements and you call add(bob,6,"..."); The passed element will not be added, the truncation string will (making a seventh element), and false is returned. The same call made again (now with seven elements) will return false and do nothing.
The type will be forced to Syntax.STRING.getName() to add the truncationString element.
isOrdered()
public int truncate(int limit)
If this WSAttribute contains a number of values that is greater than the specified limit, reduce the number of actual values to the limit. Add (beyond the limit) one final, sentinel value that indicates that values were truncated. (Otherwise, do nothing.)
limit
- - the maximum number of original values to retain.
public int truncate(int limit, java.lang.String truncationString)
If this WSAttribute contains a number of values that is greater than the specified limit, reduce the number of actual values to the limit. Add (beyond the limit) one final, sentinel value that indicates that values were truncated. (Otherwise, do nothing.)
limit
- - the maximum number of original values to retain.truncationString
- - the final, sentinel value that indicates truncation.
public void setValue(int n, java.lang.Object attrVal)
n
- - the index of the value to replace.public void setValue(java.lang.Object attrVal)
public void setValues(java.lang.Object[] attrVals)
public void setValues(java.util.List attrVals)
public void clear()
public java.lang.String getID()
public java.lang.String getName()
public int size()
public java.lang.Object get()
public java.lang.Object getValue()
public java.lang.Object get(int n)
public java.lang.Object getValue(int n)
public java.lang.Object[] getAll()
public boolean getMultiValued()
public java.lang.String getValueAsString()
public java.lang.String getValueAsString(int n)
public AttributeValues getAttrValues()
public java.lang.String toString()
public boolean isOrdered()
public void setIsOrdered(boolean ord)
public java.lang.String getType()
public void setType(java.lang.String type)
public void setName(java.lang.String name)
public void setSyntax(Syntax syntax)
public java.lang.Object getStandardValue()
public java.lang.String toXml()
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
public void toXml(java.lang.StringBuffer buf, int indent)
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
public void toXml(java.lang.StringBuffer buf)
AbstractXmlObject
toXml
in class AbstractXmlObject
public void parseXml(java.lang.String xml) throws WavesetException
WavesetException
public void parseXml(org.w3c.dom.Element e) throws WavesetException
WavesetException
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |