|
XBRLAPIA Java API for XBRL |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xbrlapi.impl.FragmentImpl
public class FragmentImpl
Implements the functionality that is common to all types of XBRL fragments.
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
FragmentImpl()
No argument constructor |
|
| Method Summary | ||
|---|---|---|
void |
appendElementSchemeXPointer(String expression)
Add an element Scheme XPointer Expression to the metadata. |
|
void |
appendID(String id)
Add an ID (used in XPointer resolution) to the metadata. |
|
void |
appendMetadataElement(String eName,
HashMap<String,String> attributes)
Appends a child element to the root metadata element. |
|
int |
compareTo(Fragment other)
Comparison is based upon the fragment index. |
|
boolean |
equals(Object o1)
Override the Object equals method to base equality on the fragment index. |
|
FragmentList<Fragment> |
getAllChildren()
Gets all child fragments. |
|
Fragment |
getAncestorOrSelf(String type)
Gets the ancestor (or self) fragment with the specified fragment type. |
|
Builder |
getBuilder()
Get the fragment builder. |
|
protected Fragment |
getChild(String type,
int index)
Get a specific child fragment. |
|
protected
|
getChildren(String type)
Gets the child fragments with the specified fragment type. |
|
Element |
getDataRootElement()
Get the root element of the fragment data. |
|
Document |
getDocumentNode()
Get the XML DOM Document for the fragment data. |
|
String |
getFragmentIndex()
Get the fragment index from the fragment metadata. |
|
FragmentList<LabelResource> |
getLabels()
TODO Add methods to get labels based on language and role. |
|
FragmentList<LabelResource> |
getLabels(Networks networks)
|
|
FragmentList<LabelResource> |
getLabelsWithLanguage(Networks networks,
String language)
|
|
FragmentList<LabelResource> |
getLabelsWithLanguage(String language)
|
|
FragmentList<LabelResource> |
getLabelsWithLanguageAndRole(Networks networks,
String language,
String role)
|
|
FragmentList<LabelResource> |
getLabelsWithLanguageAndRole(String language,
String role)
|
|
FragmentList<LabelResource> |
getLabelsWithRole(Networks networks,
String role)
|
|
FragmentList<LabelResource> |
getLabelsWithRole(String role)
|
|
String |
getLocalname()
Get the local name of the fragment's root element |
|
String |
getLocalnameFromQName(String qname)
Returns the local name for a QName |
|
String |
getMetaAttribute(String name)
Get a fragment metadata attribute. |
|
Element |
getMetadataRootElement()
Get the root element of the fragment data. |
|
String |
getNamespaceFromQName(String qname,
Node node)
Returns the Namespace for a QName in the context of a node in the fragment. |
|
String |
getNamespaceURI()
Get the namespace of the fragment root element. |
|
Networks |
getNetworks()
|
|
Networks |
getNetworksFromWithArcrole(String arcrole)
|
|
Networks |
getNetworksFromWithRoleAndArcrole(String linkrole,
String arcrole)
|
|
Networks |
getNetworksWithArcrole(String arcrole)
|
|
Fragment |
getParent()
Get the parent fragment of this fragment or null if there is none. |
|
Element |
getParentElement(Element parentDataRootElement)
Get the element in the parent fragment that has this fragment as its child. |
|
String |
getParentIndex()
Get the index of the parent fragment or null if the fragment does not have a parent fragment. |
|
String |
getPrecedingSiblings()
Get the number of children that precede this fragment's root element in document order in the element that contains it (in the parent element). |
|
String |
getPrefixFromQName(String qname)
Returns the Namespace prefix for a QName |
|
FragmentList<ReferenceResource> |
getReferences()
TODO Add methods to get references based on language and role. |
|
FragmentList<Locator> |
getReferencingLocators()
Retrieves a list of all locators that target this fragment. |
|
List<Relationship> |
getRelationshipsToWithArcrole(String arcrole)
|
|
|
getRelatives(String arcrole,
String linkrole,
String resourcerole,
String language,
boolean getTargets)
|
|
Element |
getResource()
Get the XML resource that is the fragment from the data store. |
|
String[] |
getSequenceToParentElement()
Get the sequence of steps through the parent fragment DOM to the parent element. |
|
String |
getSequenceToParentElementAsString()
Get the sequence of steps through the parent fragment DOM to the parent element as a string. |
|
FragmentList<SimpleLink> |
getSimpleLinks()
|
|
Store |
getStore()
Get the data store that manages this fragment. |
|
String |
getType()
Get the Fragment type. |
|
String |
getURI()
Get the URI of the document containing this fragment. |
|
String |
getXPath()
Get the XPath to the element in the parent fragment that is the parent element of this fragment's root element. |
|
int |
hashCode()
Override the Object hashCode method to provide for equality comparisons that are based on the fragment index. |
|
boolean |
isa(String superType)
|
|
boolean |
isNewFragment()
Tests if a fragment is new in the sense that it does not have a root data element. |
|
void |
removeElementSchemeXPointer(String expression)
Remove an element Scheme XPointer Expression from the metadata. |
|
void |
removeID(String id)
Remove an ID from the metadata. |
|
void |
removeMetaAttribute(String name)
Removes a metadata attribute |
|
void |
removeMetadataElement(String eName,
HashMap<String,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. |
|
void |
removeRelationship(String index)
Remove a DTS relationship to the fragment, identifying another DTS fragment that this fragment is no longer related to. |
|
void |
setBuilder(Builder builder)
Set the builder that constructs the fragment XML during parsing. |
|
void |
setFragmentIndex(String index)
Set the fragment index. |
|
void |
setMetaAttribute(String name,
String value)
Set a fragment metadata attribute. |
|
void |
setParentIndex(String index)
Set the index of the parent fragment. |
|
void |
setPrecedingSiblings(Vector<Long> children)
Set the number of children that precede this fragment's root element in document order in the element that contains it (in the parent element). |
|
void |
setResource(Element rootElement)
Closes down the fragment builder and sets the data and metadata resources for the fragment. |
|
void |
setSequenceToParentElement(Vector<Long> children)
Sets the sequence of child element counts that describe the path through the parent fragment from its root to the element that has this fragment's root as a child element. |
|
void |
setStore(Store store)
Set the data store that manages this fragment. |
|
void |
setURI(String uri)
Set the URI of the fragment's document. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public FragmentImpl()
XBRLEception| Method Detail |
|---|
public void setStore(Store store)
throws XBRLException
Fragment
setStore in interface Fragmentstore - The data store.
XBRLException - if the data store has already been set.Fragment.setStore(Store)public void setBuilder(Builder builder)
Fragment
setBuilder in interface Fragmentbuilder - The builder object used to construct the fragment XML.Fragment.setBuilder(Builder)public Store getStore()
Fragment
getStore in interface FragmentFragment.getStore()
public Fragment getAncestorOrSelf(String type)
throws XBRLException
Fragment
getAncestorOrSelf in interface Fragmenttype - The required fragment type of the ancestor (or self).
XBRLException - if no such ancestor fragment exists.Fragment.getAncestorOrSelf(String)
protected <F extends Fragment> FragmentList<F> getChildren(String type)
throws XBRLException
type - The required fragment type of the child.
XBRLException
public FragmentList<SimpleLink> getSimpleLinks()
throws XBRLException
getSimpleLinks in interface FragmentXBRLExceptionFragment.getSimpleLinks()
public FragmentList<Fragment> getAllChildren()
throws XBRLException
Fragment
getAllChildren in interface FragmentXBRLExceptionFragment.getAllChildren()
protected Fragment getChild(String type,
int index)
throws XBRLException
type - The fragment type of the required childindex - The index of the required child fragment (among other children of the same type).
XBRLException - if the index is out of boundspublic Builder getBuilder()
Fragment
getBuilder in interface FragmentFragment.getBuilder()
public Element getResource()
throws XBRLException
Fragment
getResource in interface FragmentXBRLExceptionFragment.getResource()
public void setResource(Element rootElement)
throws XBRLException
Fragment
setResource in interface FragmentrootElement - The fragment data.
XBRLException - If the builder cannot be shut down or if the
resource cannot be set or is null.Fragment.setResource(Element)
public Element getDataRootElement()
throws XBRLException
Fragment
getDataRootElement in interface FragmentXBRLExceptionFragment.getDataRootElement()
public Element getMetadataRootElement()
throws XBRLException
Fragment
getMetadataRootElement in interface FragmentXBRLExceptionFragment.getMetadataRootElement()
public Document getDocumentNode()
throws XBRLException
Fragment
getDocumentNode in interface FragmentXBRLException - if the fragment has not yet been stored.Fragment.getDocumentNode()
public boolean isNewFragment()
throws XBRLException
Fragment
isNewFragment in interface FragmentXBRLExceptionFragment.isNewFragment()public String getFragmentIndex()
Fragment
getFragmentIndex in interface FragmentFragment.getFragmentIndex()
public void setFragmentIndex(String index)
throws XBRLException
Fragment
setFragmentIndex in interface FragmentXBRLExceptionFragment.setFragmentIndex(String)public String getType()
Fragment
getType in interface FragmentFragment.getType()
public void setMetaAttribute(String name,
String value)
throws XBRLException
Fragment
setMetaAttribute in interface Fragmentname - the name of the attributevalue - the value to give to the metadata attribute
XBRLExceptionFragment.setMetaAttribute(String, String)
public void removeMetaAttribute(String name)
throws XBRLException
Fragment
removeMetaAttribute in interface Fragmentname - The name of the attribute to remove
XBRLExceptionFragment.removeMetaAttribute(String)
public String getMetaAttribute(String name)
throws XBRLException
Fragment
getMetaAttribute in interface Fragmentname - the name of the attribute.
XBRLExceptionFragment.getMetaAttribute(String)
public void appendMetadataElement(String eName,
HashMap<String,String> attributes)
throws XBRLException
Fragment
appendMetadataElement in interface FragmenteName - Name of the element to be added (no namespaces are used).attributes - A hashmap from attribute name keys to attribute values.
XBRLExceptionFragment.appendMetadataElement(String, HashMap)
public void removeMetadataElement(String eName,
HashMap<String,String> attributes)
throws XBRLException
Fragment
removeMetadataElement in interface FragmenteName - 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.Fragment.removeMetadataElement(String, HashMap)
public String getURI()
throws XBRLException
Fragment
getURI in interface FragmentXBRLExceptionFragment.getURI()
public void setURI(String uri)
throws XBRLException
Fragment
setURI in interface Fragmenturi - The string value of the document's absolute URI
XBRLExceptionFragment.setURI(String)
public FragmentList<Locator> getReferencingLocators()
throws XBRLException
Fragment
getReferencingLocators in interface FragmentXBRLExceptionFragment.getReferencingLocators()
public FragmentList<LabelResource> getLabels(Networks networks)
throws XBRLException
getLabels in interface Fragmentnetworks - The networks to use to obtain the labels.
XBRLExceptionFragment.getLabels(org.xbrlapi.networks.Networks)
public FragmentList<LabelResource> getLabels()
throws XBRLException
getLabels in interface FragmentXBRLExceptionFragment.getLabels()
public FragmentList<LabelResource> getLabelsWithRole(Networks networks,
String role)
throws XBRLException
getLabelsWithRole in interface Fragmentnetworks - The networks to get the labels from.role - The XLink role value
XBRLExceptionFragment.getLabelsWithRole(Networks, String)
public FragmentList<LabelResource> getLabelsWithRole(String role)
throws XBRLException
getLabelsWithRole in interface Fragmentrole - The XLink role value
XBRLExceptionFragment.getLabelsWithRole(String)
public FragmentList<LabelResource> getLabelsWithLanguage(Networks networks,
String language)
throws XBRLException
getLabelsWithLanguage in interface Fragmentnetworks - The networks to get the labels from.language - The xml:lang language codevalue
XBRLExceptionFragment.getLabelsWithLanguage(Networks, String)
public FragmentList<LabelResource> getLabelsWithLanguage(String language)
throws XBRLException
getLabelsWithLanguage in interface Fragmentlanguage - The xml:lang language codevalue
XBRLExceptionFragment.getLabelsWithLanguage(String)
public FragmentList<LabelResource> getLabelsWithLanguageAndRole(Networks networks,
String language,
String role)
throws XBRLException
getLabelsWithLanguageAndRole in interface Fragmentnetworks - The networks to get the labels from.language - The xml:lang language codevaluerole - The XLink role value
XBRLExceptionFragment.getLabelsWithLanguageAndRole(Networks, String, String)
public FragmentList<LabelResource> getLabelsWithLanguageAndRole(String language,
String role)
throws XBRLException
getLabelsWithLanguageAndRole in interface Fragmentlanguage - The xml:lang language codevaluerole - The XLink role value
XBRLExceptionFragment.getLabelsWithLanguageAndRole(String, String)
public FragmentList<ReferenceResource> getReferences()
throws XBRLException
getReferences in interface FragmentXBRLExceptionFragment.getReferences()
public Networks getNetworks()
throws XBRLException
getNetworks in interface FragmentXBRLExceptionFragment.getNetworks()
public Networks getNetworksWithArcrole(String arcrole)
throws XBRLException
getNetworksWithArcrole in interface Fragmentarcrole - the required arcrole value.
XBRLExceptionFragment.getNetworksWithArcrole(String)
public Networks getNetworksFromWithArcrole(String arcrole)
throws XBRLException
getNetworksFromWithArcrole in interface Fragmentarcrole - the required arcrole value.
XBRLExceptionFragment.getNetworksFromWithArcrole(String)
public Networks getNetworksFromWithRoleAndArcrole(String linkrole,
String arcrole)
throws XBRLException
getNetworksFromWithRoleAndArcrole in interface Fragmentlinkrole - the required linkrole value.arcrole - the required arcrole value.
XBRLExceptionFragment.getNetworksFromWithRoleAndArcrole(String, String)
public <F extends Fragment> FragmentList<F> getRelatives(String arcrole,
String linkrole,
String resourcerole,
String language,
boolean getTargets)
throws XBRLException
getRelatives in interface Fragmentarcrole - The xlink:arcrole attribute on the arcs expressing the
relationships to the relative fragments.linkrole - The xlink:role attribute on the extended links containing
the relationships to the relative fragments. This criteria is not used if the value is null.resourcerole - The required xlink:role attribute value on the
related fragments. This criteria is not used if the value is null.language - The required value of the xml:language language
encoding on the relative fragments. This criteria is not used if the value is null.getTargets - The boolean value that is set to true if the relatives are required
to be targets of relationships from this fragment and that is set to false otherwise.
XBRLExceptionFragment.getRelatives(String, String, String, String, boolean)
public boolean isa(String superType)
throws XBRLException
isa in interface FragmentsuperType - The specified fragment type to test against.
XBRLExceptionFragment.isa(String)
public String getParentIndex()
throws XBRLException
Fragment
getParentIndex in interface FragmentXBRLException - if the parent fragment index is not available.Fragment.getParentIndex()
public void setParentIndex(String index)
throws XBRLException
Fragment
setParentIndex in interface Fragmentindex - The index of the parent fragment.
XBRLException - if the parent fragment index cannot be set.Fragment.setParentIndex(String)
public String getXPath()
throws XBRLException
Fragment
getXPath in interface FragmentXBRLExceptionFragment.getXPath()
public void setSequenceToParentElement(Vector<Long> children)
throws XBRLException
Fragment
setSequenceToParentElement in interface Fragmentchildren - The vector of long integers giving the children counts for the parent fragment.
XBRLExceptionFragment.setSequenceToParentElement(Vector)
public String[] getSequenceToParentElement()
throws XBRLException
Fragment
getSequenceToParentElement in interface FragmentXBRLExceptionFragment.getSequenceToParentElement()
public String getSequenceToParentElementAsString()
throws XBRLException
Fragment
getSequenceToParentElementAsString in interface FragmentXBRLExceptionFragment.getSequenceToParentElementAsString()
public String getPrecedingSiblings()
throws XBRLException
Fragment
getPrecedingSiblings in interface FragmentXBRLExceptionFragment.getPrecedingSiblings()
public void setPrecedingSiblings(Vector<Long> children)
throws XBRLException
Fragment
setPrecedingSiblings in interface Fragmentchildren - The list of children counts for the parent fragment.
XBRLException - if the parent fragment index cannot be set.Fragment.setPrecedingSiblings(Vector)
public void removeRelationship(String index)
throws XBRLException
Fragment
removeRelationship in interface Fragmentindex - The index of the target of the relationship to be removed.
XBRLExceptionFragment.removeRelationship(String)
public void appendID(String id)
throws XBRLException
Fragment
appendID in interface Fragmentid - The value of the ID.
XBRLExceptionTODO Eliminate the ID metadata element given the existence of the xptr elements.
public void removeID(String id)
throws XBRLException
Fragment
removeID in interface Fragmentid - The id to remove.
XBRLExceptionTODO remove the redundant parameter from this method.
public void appendElementSchemeXPointer(String expression)
throws XBRLException
Fragment
appendElementSchemeXPointer in interface Fragmentexpression - The XPointer expression