XBRLAPI

A Java API for XBRL


org.xbrlapi.builder
Interface Builder

All Known Implementing Classes:
BuilderImpl

public interface Builder

Methods exposed by the fragment builder.

Author:
Geoffrey Shuetrim (geoff@galexy.net)

Method Summary
 void appendAttributeDecl(String eName, String aName, String type, String valueDefault, String value)
          Append an attribute DTD declaration
 void appendComment(String text)
          Append a comment node.
 void appendElement(String namespaceURI, String lName, String qName)
          Insert a new element without attributes.
 void appendElement(String namespaceURI, String lName, String qName, Attributes attrs)
          Append an element node.
 void appendElementDecl(String name, String model)
          Append an element DTD declaration.
 void appendExternalEntityDecl(String name, String publicId, String systemId)
          Append an external entity DTD declarations
 void appendInternalEntityDecl(String name, String value)
          Append an internal entity DTD declaration.
 void appendMetadataElement(String eName, HashMap<String,String> attributes)
          Appends a child element to the root metadata element.
 void appendNotationDecl(String name, String publicId, String systemId)
          Append a notation declaration.
 void appendProcessingInstruction(String target, String data)
          Append a processing instruction node
 void appendText(String text)
          Append a text node.
 void appendUnparsedEntityDecl(String name, String publicId, String systemId, String notationName)
          Append an unparsed entity declaration.
 void endElement(String namespaceURI, String lName, String qName)
          Update the insertion point for new content when reaching the end of an element.
 Element getData()
          Get the Document object used to build the fragment.
 Element getInsertionPoint()
          Get the insertion point for new content.
 String getMetaAttribute(String name)
          Get a metadata attribute.
 Element getMetadata()
          Get the metadata DOM document.
 boolean isNewFragment()
          Returns true iff the builder has not yet added an element to the fragment.
 void removeMetaAttribute(String name)
          Remove 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 setMetaAttribute(String name, String value)
          Set a metadata attribute.
 

Method Detail

getData

Element getData()
Get the Document object used to build the fragment.

Returns:
the data XML structure.

getMetadata

Element getMetadata()
Get the metadata DOM document.

Returns:
the metadata XML structure.

getInsertionPoint

Element getInsertionPoint()
Get the insertion point for new content.

Returns:
The XML DOM Element to contain new content.

isNewFragment

boolean isNewFragment()
Returns true iff the builder has not yet added an element to the fragment.

Returns:
true iff the builder has not yet added an element to the fragment.

appendText

void appendText(String text)
                throws XBRLException
Append a text node.

Parameters:
text - The node to be appended.
Throws:
XBRLException - if the node cannot be appended.

appendProcessingInstruction

void appendProcessingInstruction(String target,
                                 String data)
                                 throws XBRLException
Append a processing instruction node

Parameters:
target - The processing target application identifier.
data - The data defining what is to be done.
Throws:
XBRLException - if the node cannot be appended.

appendComment

void appendComment(String text)
                   throws XBRLException
Append a comment node.

Parameters:
text - The data constituting the content of the comment.
Throws:
XBRLException - if the node cannot be appended.

appendElement

void appendElement(String namespaceURI,
                   String lName,
                   String qName,
                   Attributes attrs)
                   throws XBRLException
Append an element node.

Parameters:
namespaceURI - The namespace of the element found by the SAX parser.
lName - The local name of the element found by the SAX parser.
qName - The QName of the element found by the SAX parser.
attrs - The set of attributes found by the SAX parser.
Throws:
XBRLException - if the node cannot be appended.

appendElement

void appendElement(String namespaceURI,
                   String lName,
                   String qName)
                   throws XBRLException
Insert a new element without attributes.

Parameters:
namespaceURI - The namespace of the element found by the SAX parser.
lName - The local name of the element found by the SAX parser.
qName - The QName of the element found by the SAX parser.
Throws:
XBRLException - if the node cannot be appended.

endElement

void endElement(String namespaceURI,
                String lName,
                String qName)
                throws XBRLException
Update the insertion point for new content when reaching the end of an element. TODO try to make endElement this a private method.

Parameters:
namespaceURI - The namespace URI of the element that is ending.
lName - The local name of the element that is ending.
qName - The QName of the element that is ending.
Throws:
XBRLException - if the current insertion point is not an element node or if the new (parent) insertion point is not an element node.

appendNotationDecl

void appendNotationDecl(String name,
                        String publicId,
                        String systemId)
                        throws XBRLException
Append a notation declaration.

Throws:
XBRLException

appendUnparsedEntityDecl

void appendUnparsedEntityDecl(String name,
                              String publicId,
                              String systemId,
                              String notationName)
                              throws XBRLException
Append an unparsed entity declaration.

Throws:
XBRLException

appendElementDecl

void appendElementDecl(String name,
                       String model)
                       throws XBRLException
Append an element DTD declaration.

Throws:
XBRLException

appendInternalEntityDecl

void appendInternalEntityDecl(String name,
                              String value)
                              throws XBRLException
Append an internal entity DTD declaration.

Throws:
XBRLException

appendExternalEntityDecl

void appendExternalEntityDecl(String name,
                              String publicId,
                              String systemId)
                              throws XBRLException
Append an external entity DTD declarations

Throws:
XBRLException

appendAttributeDecl

void appendAttributeDecl(String eName,
                         String aName,
                         String type,
                         String valueDefault,
                         String value)
                         throws XBRLException
Append an attribute DTD declaration

Throws:
XBRLException

setMetaAttribute

void setMetaAttribute(String name,
                      String value)
Set a metadata attribute.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

getMetaAttribute

String getMetaAttribute(String name)
Get a metadata attribute.

Parameters:
name - The name of the attribute.
Returns:
the string value of the metadata attribute or null if it is not specified.

removeMetaAttribute

void removeMetaAttribute(String name)
Remove a metadata attribute.

Parameters:
name - The name of the attribute.

appendMetadataElement

void appendMetadataElement(String eName,
                           HashMap<String,String> attributes)
                           throws XBRLException
Appends a child element to the root metadata element.

Parameters:
eName - Name of the element to be added (no namespaces are used).
attributes - A hashmap from attribute name keys to attribute values.
Throws:
XBRLException - if the metadata element cannot be appended.

removeMetadataElement

void removeMetadataElement(String eName,
                           HashMap<String,String> attributes)
                           throws XBRLException
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. All specified information must match for the deletion to succeed.

Parameters:
eName - Name of the element to be added (no namespaces are used).
attributes - A hashmap from attribute name keys to attribute values.
Throws:
XBRLException - if the metadata element cannot be removed.

SourceForge Logo