public class XMLImpl extends java.lang.Object implements XML
Constructor and Description |
---|
XMLImpl() |
Modifier and Type | Method and Description |
---|---|
void |
appendMetadataElement(java.lang.String eName,
java.util.Map<java.lang.String,java.lang.String> attributes)
Appends a child element to the root metadata element.
|
int |
compareTo(XML other)
Comparison is based upon the fragment index.
|
boolean |
equals(java.lang.Object obj)
Override the Object equals method to base equality on the
fragment index.
|
Builder |
getBuilder()
Get the fragment builder.
|
org.w3c.dom.Document |
getDocumentNode()
Get the XML DOM Document for the fragment data.
|
java.lang.String |
getIndex()
Get the index of the XML resource.
|
java.lang.String |
getMetaAttribute(java.lang.String name)
Get a fragment metadata attribute.
|
org.w3c.dom.Element |
getMetadataRootElement()
Get the root element of the fragment metadata.
|
Store |
getStore()
Get the data store that manages this fragment.
|
java.lang.String |
getType()
Get the Fragment type.
|
int |
hashCode()
Override the Object hashCode method to provide for equality comparisons
that are based on the fragment index.
|
boolean |
hasMetaAttribute(java.lang.String name) |
boolean |
isa(java.lang.Class<?> targetClass) |
boolean |
isa(java.lang.String type) |
void |
removeMetaAttribute(java.lang.String name)
Removes a metadata attribute
|
void |
removeMetadataElement(java.lang.String eName,
java.util.HashMap<java.lang.String,java.lang.String> attributes)
removes a child element from the metadata root element by specifying the name of the child and
the value of the element's text content and/or the value of a named attribute.
|
java.lang.String |
serialize() |
void |
serialize(java.io.File file)
Serializes the XML to the specified file.
|
void |
serialize(java.io.OutputStream outputStream)
Serializes the XML to the specified output stream.
|
void |
setBuilder(Builder builder)
Set the builder that constructs the fragment XML during parsing.
|
void |
setIndex(java.lang.String index)
Set the fragment index.
|
void |
setMetaAttribute(java.lang.String name,
java.lang.String value)
Set a fragment metadata attribute.
|
void |
setResource(org.w3c.dom.Element rootElement)
Closes down the fragment builder and sets the data and metadata
resources for the fragment.
|
void |
setStore(Store store)
Set the data store that manages this fragment.
|
void |
updateInStore()
Updates the data store to reflect the current state of
this XML object.
|
public boolean isa(java.lang.String type) throws XBRLException
isa
in interface XML
type
- The specified fragment type to test against.XBRLException
XML.isa(String)
public boolean isa(java.lang.Class<?> targetClass)
isa
in interface XML
targetClass
- The specified XML resource subclass to test against.XML.isa(Class)
public int hashCode()
XML
public boolean equals(java.lang.Object obj)
XML
public int compareTo(XML other) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable<XML>
java.lang.ClassCastException
Comparable.compareTo(Object o)
public void setResource(org.w3c.dom.Element rootElement) throws XBRLException
XML
setResource
in interface XML
rootElement
- The fragment data.XBRLException
- If the builder cannot be shut down or if the
resource cannot be set or is null.XML.setResource(Element)
public org.w3c.dom.Document getDocumentNode()
XML
getDocumentNode
in interface XML
XML.getDocumentNode()
public void setStore(Store store) throws XBRLException
XML
setStore
in interface XML
store
- The data store.XBRLException
- if the data store has already been set.XML.setStore(Store)
public void setBuilder(Builder builder)
XML
setBuilder
in interface XML
builder
- The builder object used to construct the fragment XML.XML.setBuilder(Builder)
public Store getStore()
XML
getStore
in interface XML
XML.getStore()
public Builder getBuilder()
XML
getBuilder
in interface XML
XML.getBuilder()
public org.w3c.dom.Element getMetadataRootElement()
XML
getMetadataRootElement
in interface XML
XML.getMetadataRootElement()
public java.lang.String getIndex()
XML
getIndex
in interface XML
XML.getIndex()
public void setIndex(java.lang.String index) throws XBRLException
XML
setIndex
in interface XML
XBRLException
XML.setIndex(String)
public java.lang.String getType()
XML
getType
in interface XML
XML.getType()
public void setMetaAttribute(java.lang.String name, java.lang.String value) throws XBRLException
XML
setMetaAttribute
in interface XML
name
- the name of the attributevalue
- the value to give to the metadata attributeXBRLException
XML.setMetaAttribute(String, String)
public void removeMetaAttribute(java.lang.String name) throws XBRLException
XML
removeMetaAttribute
in interface XML
name
- The name of the attribute to removeXBRLException
XML.removeMetaAttribute(String)
public java.lang.String getMetaAttribute(java.lang.String name)
XML
getMetaAttribute
in interface XML
name
- the name of the attribute.XML.getMetaAttribute(String)
public boolean hasMetaAttribute(java.lang.String name)
hasMetaAttribute
in interface XML
name
- the name of the attribute.XML.getMetaAttribute(String)
public void appendMetadataElement(java.lang.String eName, java.util.Map<java.lang.String,java.lang.String> attributes) throws XBRLException
XML
appendMetadataElement
in interface XML
eName
- Name of the element to be added (no namespaces are used).attributes
- A map from attribute name keys to attribute values.XBRLException
XML.appendMetadataElement(String, Map)
public void removeMetadataElement(java.lang.String eName, java.util.HashMap<java.lang.String,java.lang.String> attributes) throws XBRLException
XML
removeMetadataElement
in interface XML
eName
- Name of the element to be added (no namespaces are used).attributes
- A hashmap from attribute name keys to attribute values.XBRLException
- If no deletion happens.XML.removeMetadataElement(String, HashMap)
public void serialize(java.io.File file) throws XBRLException
XML
serialize
in interface XML
file
- The specified output file.XBRLException
XML.serialize(File)
public void serialize(java.io.OutputStream outputStream) throws XBRLException
XML
serialize
in interface XML
outputStream
- The specified output stream.XBRLException
XML.serialize(OutputStream)
public java.lang.String serialize() throws XBRLException
serialize
in interface XML
XBRLException
XML.serialize()
public void updateInStore() throws XBRLException
XML
updateInStore
in interface XML
XBRLException
XML.updateInStore()