public class GCListValue extends GCValue
"list" type Global Configuration Values.
GCVs of type "list" have a value that corresponds to the
items in the list.
The value is represented in different ways depending on where the GCV is referenced. In text-replacement, the list is represented in one of two ways:
Items in the list have a defined order based on the order in which the items appear in the definition.
GCValue.IllegalCloneStateException, GCValue.XmlComment, GCValue.XmlItem, GCValue.XmlProcessingInstruction| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SEPARATOR |
modified, parent, TYPE_BOOLEAN, TYPE_DN, TYPE_DN_REF, TYPE_ENUM, TYPE_GCV_REF, TYPE_GROUP, TYPE_HEADER, TYPE_INTEGER, TYPE_LIST, TYPE_PASSWORD_REF, TYPE_REAL, TYPE_STRING, TYPE_STRUCTURED, TYPE_SUBORDINATES, xmlItems| Modifier and Type | Method and Description |
|---|---|
void |
appendListItem(java.lang.String item)
Append a new list item.
|
GCValue |
cloneValue(java.lang.String name)
Clone this
GCValue instance and return the cloned instance. |
java.lang.String |
getSeparator()
Return the separator string for this list.
|
java.lang.String |
getValue()
Return the current value of this instance.
|
org.w3c.dom.Node |
getXMLValue(org.w3c.dom.Document document)
Return an XML node representing this GCV's value.
|
void |
insertListItem(java.lang.String item,
int insertionPoint)
Insert a new item into this list.
|
java.util.Iterator |
iterator()
Return an
Iterator for use in iterating through the
list item Strings in this instance. |
void |
parseValue(java.lang.String value)
Parse the passed value based on the type and instance rules
for
"list" GCVs. |
boolean |
removeListItem(int index)
Remove an item from this list
|
boolean |
removeListItem(java.lang.String item,
boolean removeAll)
Remove an item from this list
|
void |
setSeparator(java.lang.String separator)
Set the separator string for this list.
|
void |
setTypeHint(java.lang.String hint)
Programmatically set the type-hint value.
|
void |
setValue(java.lang.String value)
Set the value for this instance.
|
addXmlComment, addXmlItems, addXmlProcessingInstruction, cloneCommon, construct, construct, constructGCVRef, constructGCVRef, constructGroup, constructHeader, constructStructuredValue, constructSubordinates, getDescription, getDescriptionRef, getDisplayName, getDisplayNameRef, getHidden, getMandatory, getName, getOwner, getParent, getType, getTypeString, getXmlItemsIterator, hasBeenModified, localize, resetModified, setDescription, setDescriptionRef, setDisplayName, setDisplayNameRef, setHidden, setMandatory, toXML, typeFromStringpublic static final java.lang.String DEFAULT_SEPARATOR
public GCValue cloneValue(java.lang.String name)
GCValue instance and return the cloned instance.cloneValue in class GCValuethe - name for the cloned value.public void setTypeHint(java.lang.String hint)
hint - null, or one of GCVDtd.VAL_STRING, GCVDtd.VAL_BOOLEAN,
GCVDtd.VAL_INTEGER, GCVDtd.VAL_REAL, GCVDtd.VAL_DNjava.lang.IllegalArgumentException - thrown if hint isn't null or one of the allowed values.public void parseValue(java.lang.String value)
throws GCVException
"list" GCVs.
The passed value must be in the form <item><separator><item>, etc.
parseValue in class GCValuevalue - Value String to parseGCVException - thrown if value is not correct for this value instance.public java.lang.String getValue()
This will return a string containing all of the list items, each separated by the separator string.
public org.w3c.dom.Node getXMLValue(org.w3c.dom.Document document)
Text node containing the value
returned by getValue(). Certain GCV types (e.g., list) may
return more structured data.getXMLValue in class GCValuedocument - the Document to use to create nodes.Node that is the root of the XML representation.public void setValue(java.lang.String value)
throws GCVException
The passed value must be in the form <item><separator><item>, etc.
setValue in class GCValuevalue - Value string for this instance.GCVException - thrown if value is not correct for this value instance.public java.lang.String getSeparator()
String containing separator used to separate items in
single-string representation of the list.public void setSeparator(java.lang.String separator)
The separator string separates list items in the flat, single-string representation of the list.
separator - The separator string.public void appendListItem(java.lang.String item)
null, which will result
in an empty list item.item - The String value of the item.public void insertListItem(java.lang.String item,
int insertionPoint)
item - The item to insert.insertionPoint - the index at which to insert the new item.public boolean removeListItem(int index)
index - The index of the item to remove.true if an item existed at the passed index and was removed.public boolean removeListItem(java.lang.String item,
boolean removeAll)
item - The string value of the item to remove.removeAll - if true, remove all items with the passed value.true if one or more items was removed.public java.util.Iterator iterator()
Iterator for use in iterating through the
list item Strings in this instance.Iterator that returns String objects.