public class GenericDetailSubelement extends java.lang.Object implements DetailSubelement
When parsing a CoT Event, any unrecognized (unregistered) subschema will be parsed as a GenericDetailSubelement
Constructor and Description |
---|
GenericDetailSubelement(java.lang.String name)
Creates a new GenericDetailSubelement with the given subschema (element) name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttribute(java.lang.String attributeName)
Returns the String value associated with the specified attribute name, or null if the attribute is not present in this GenericDetailSubelement.
|
java.lang.String |
getInnerXml()
Returns the XML markup representing all child elements and text content of this GenericDetailSubelement.
|
java.lang.String |
getName()
Returns the XML element name for the CoT subschema this DetailSubelement represents
|
static GenericDetailSubelement |
parse(java.lang.String xml)
Parses the String argument as a GenericDetailSubelement.
|
void |
removeAttribute(java.lang.String attributeName)
Removes the specified attribute and associated value from this GenericDetailSubelement if it is present.
|
void |
setAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Associates a specified String value with a given attribute name.
|
void |
setInnerXml(java.lang.String xml)
Replaces the XML markup representing all child elements and text content of this GenericDetailSubelement.
|
java.lang.String |
toXml()
Returns a full XML String representation of this DetailSubelement
|
public GenericDetailSubelement(java.lang.String name)
name
- the name of the subschema (XML element)java.lang.IllegalArgumentException
- if the given name is not a valid XML element namepublic java.lang.String getAttribute(java.lang.String attributeName)
attributeName
- the name of the attribute whose value is to be returnedpublic void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
attributeName
- the name of the attribute to associate the value withattributeValue
- the String value to be associated with the specified attributejava.lang.IllegalArgumentException
- if the specified attribute name is not a valid XML attribute namejava.lang.NullPointerException
- if the provided attribute name is nullpublic void removeAttribute(java.lang.String attributeName)
attributeName
- the name of the attribute to remove.public java.lang.String getInnerXml()
public void setInnerXml(java.lang.String xml)
xml
- the new String XML markup representation of all child elements and text content of this GenericDetailSubelementjava.lang.IllegalArgumentException
- if the specified String is not valid for the contents of an XML elementpublic java.lang.String getName()
DetailSubelement
getName
in interface DetailSubelement
public java.lang.String toXml()
DetailSubelement
toXml
in interface DetailSubelement
public static GenericDetailSubelement parse(java.lang.String xml)
xml
- the String to be parsed. Must be a valid XML elementjava.lang.IllegalArgumentException
- if the specified String is not a valid XML element