Package org.opensaml.core.xml.mock

# Class SimpleXMLObject

java.lang.Object
org.opensaml.core.xml.AbstractXMLObject
org.opensaml.core.xml.mock.SimpleXMLObject

All Implemented Interfaces:
  `AttributeExtensibleXMLObject`, `ElementExtensibleXMLObject`, `XMLObject`

public class SimpleXMLObject extends AbstractXMLObject implements ElementExtensibleXMLObject, AttributeExtensibleXMLObject
Simple XMLObject that can be used for testing.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final QName`
`ELEMENT_NAME`
Default element name.
`private String`
`id`
Name attribute.
`static final String`
`ID_ATTRIB_NAME`
Name attribute name.
`static final String`
`LOCAL_NAME`
Element local name.
`static final String`
`NAMESPACE`
Default namespace.
`static final String`
`NAMESPACE_PREFIX`
Default namespace prefix.
`private XMLObjectChildrenList<SimpleXMLObject>`
`simpleXMLObjects`
Child SimpleXMLObjects.
`private AttributeMap`
`unknownAttributes`
anyAttribute wildcard attributes.
`private IndexedXMLObjectChildrenList<XMLObject>`
`unknownXMLObjects`
Other children.
`private String`
`value`
Value of the object stored as text content in the element.

## Constructor Summary

Constructors
Constructor
Description
`SimpleXMLObject(String namspaceURI, String localName, String namespacePrefix)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getId()`
Gets the name attribute.
`List<XMLObject>`
`getOrderedChildren()`
Gets an unmodifiable list of child elements in the order that they will appear in the DOM.
`List<SimpleXMLObject>`
`getSimpleXMLObjects()`
Gets the list of child SimpleXMLObjects.
`AttributeMap`
`getUnknownAttributes()`
Gets a mutable map of the attributes.
`List<XMLObject>`
`getUnknownXMLObjects()`
Gets the list of XMLObjects added to this XMLObject as part of the "any" content model.
`List<XMLObject>`
`getUnknownXMLObjects(QName typeOrName)`
Gets the list of XMLObjects added to this XMLObject as part of the "any" content model, and which match the specified QName.
`String`
`getValue()`
Gets the value of this object.
`void`
`setId(String newId)`
Sets the name attribute.
`void`
`setValue(String newValue)`
Sets the value of this object.

### Methods inherited from class org.opensaml.core.xml.AbstractXMLObject

`detach, ensureDOM, getDOM, getElementQName, getIDIndex, getNamespaceManager, getNamespaces, getNoNamespaceSchemaLocation, getObjectMetadata, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, isNil, isNilXSBoolean, manageQualifiedAttributeNamespace, prepareAttributeValueForAssignment, prepareElementContentForAssignment, prepareForAssignment, prepareForAssignment, prepareForAssignment, registerOwnID, releaseChildrenDOM, releaseDOM, releaseParentDOM, releaseThisAndChildrenDOM, releaseThisandParentDOM, resolveID, resolveIDFromRoot, setDOM, setElementNamespacePrefix, setElementQName, setNil, setNil, setNoNamespaceSchemaLocation, setParent, setSchemaLocation, setSchemaType`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.opensaml.core.xml.XMLObject

`detach, ensureDOM, getDOM, getElementQName, getIDIndex, getNamespaceManager, getNamespaces, getNoNamespaceSchemaLocation, getObjectMetadata, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, isNil, isNilXSBoolean, releaseChildrenDOM, releaseDOM, releaseParentDOM, resolveID, resolveIDFromRoot, setDOM, setNil, setNil, setNoNamespaceSchemaLocation, setParent, setSchemaLocation`

## Field Details

### NAMESPACE

@Nonnull @NotEmpty public static final String NAMESPACE
Default namespace.

See Also:
  - Constant Field Values

### NAMESPACE_PREFIX

@Nonnull @NotEmpty public static final String NAMESPACE_PREFIX
Default namespace prefix.

See Also:
  - Constant Field Values

### LOCAL_NAME

@Nonnull @NotEmpty public static final String LOCAL_NAME
Element local name.

See Also:
  - Constant Field Values

### ELEMENT_NAME

@Nonnull public static final QName ELEMENT_NAME
Default element name.

### ID_ATTRIB_NAME

@Nonnull @NotEmpty public static final String ID_ATTRIB_NAME
Name attribute name.

See Also:
  - Constant Field Values

### id

@Nullable private String id
Name attribute.

### value

@Nullable private String value
Value of the object stored as text content in the element.

### simpleXMLObjects

@Nonnull private XMLObjectChildrenList<SimpleXMLObject> simpleXMLObjects
Child SimpleXMLObjects.

### unknownXMLObjects

@Nonnull private IndexedXMLObjectChildrenList<XMLObject> unknownXMLObjects
Other children.

### unknownAttributes

@Nonnull private AttributeMap unknownAttributes
anyAttribute wildcard attributes.

## Constructor Details

### SimpleXMLObject

public SimpleXMLObject(@Nullable String namspaceURI, @Nonnull String localName, @Nullable String namespacePrefix)
Constructor.

Parameters:
  `namspaceURI` - namespace for the node
  `localName` - local name for the node
  `namespacePrefix` - namespace prefix for the node

## Method Details

### getId

@Nullable public String getId()
Gets the name attribute.

Returns:
  the name attribute

### setId

public void setId(@Nullable String newId)
Sets the name attribute.

Parameters:
  `newId` - the name attribute

### getValue

@Nullable public String getValue()
Gets the value of this object.

Returns:
  the value of this object

### setValue

public void setValue(@Nullable String newValue)
Sets the value of this object.

Parameters:
  `newValue` - the value of this object

### getSimpleXMLObjects

@Nonnull public List<SimpleXMLObject> getSimpleXMLObjects()
Gets the list of child SimpleXMLObjects.

Returns:
  the list of child SimpleXMLObjects

### getUnknownXMLObjects

@Nonnull public List<XMLObject> getUnknownXMLObjects()
Gets the list of XMLObjects added to this XMLObject as part of the "any" content model.

Specified by:
  `getUnknownXMLObjects` in interface `ElementExtensibleXMLObject`
Returns:
  list of XMLObjects added to this XMLObject as part of the "any" content model

### getUnknownXMLObjects

@Nonnull public List<XMLObject> getUnknownXMLObjects(@Nonnull QName typeOrName)
Gets the list of XMLObjects added to this XMLObject as part of the "any" content model, and which match the specified QName.

Specified by:
  `getUnknownXMLObjects` in interface `ElementExtensibleXMLObject`
Parameters:
  `typeOrName` - the QName of the statements to return
Returns:
  list of XMLObjects added to this XMLObject as part of the "any" content model TODO: think this should be typed List<? extends XMLObject>

### getOrderedChildren

@Nullable public List<XMLObject> getOrderedChildren()
Gets an unmodifiable list of child elements in the order that they will appear in the DOM.

Specified by:
  `getOrderedChildren` in interface `XMLObject`
Returns:
  ordered list of child elements

### getUnknownAttributes

@Nonnull public AttributeMap getUnknownAttributes()
Gets a mutable map of the attributes. The map key is the namespace qualified name of the attribute, the map value is the value of the attribute.

Specified by:
  `getUnknownAttributes` in interface `AttributeExtensibleXMLObject`
Returns:
  a map of the attributes