XBRLAPI

A Java API for XBRL


org.xbrlapi.sax.identifiers
Interface Identifier

All Known Implementing Classes:
BaseIdentifier, GenericDocumentRootIdentifier, LanguageIdentifier, ReferencePartIdentifier, SchemaIdentifier, SchemaIdentifier, XBRLIdentifier, XBRLXLinkIdentifier

public interface Identifier

The fragment identifier interface is implemented by any class that is to be used by a SAX content handler to identify fragments. Usage of fragment identifiers requires: 1. implementing the initialisation of the identifier - including setting up any properties specific to the type of identifier being configured. 2. implementing the adjustment of the state of the fragment identifier whenever the end of an element is encountered by the SAX parser. 3. implementing the fragment recognition code. Fragment identifiers are instantiated and initialised by the documentStart event handler in the SAX content handler. Fragment identification and state updating is triggered within the elementStart event handler. Fragment state updating is triggered within the elementEnd event handler.

Author:
Geoffrey Shuetrim (geoff@galexy.net)

Method Summary
 void endElement(String namespaceURI, String lName, String qName, Attributes attrs)
          Updates the state of the fragment identifier when the end of an element is parsed.
 ContentHandler getContentHandler()
           
 ElementState getElementState()
           
 Loader getLoader()
           
 void processFragment(Fragment fragment, Attributes attrs)
          Set up the fragment index, handle ID metadata for the fragment and add it to the loader.
 void setContentHandler(ContentHandler contentHandler)
           
 void startElement(String namespaceURI, String lName, String qName, Attributes attrs)
          Determines if the element starts a new fragment and if so: creates the fragment sets the fragment index stores any ID attributes on the fragment root in the fragment metadata and in the element state object adds the fragment to the loader
 

Method Detail

startElement

void startElement(String namespaceURI,
                  String lName,
                  String qName,
                  Attributes attrs)
                  throws XBRLException
Determines if the element starts a new fragment and if so:

Parameters:
namespaceURI - the namespace of the element
lName - the local name of the element
qName - the qname of the element
attrs - the attributes of the element
Throws:
XBRLException

endElement

void endElement(String namespaceURI,
                String lName,
                String qName,
                Attributes attrs)
                throws XBRLException
Updates the state of the fragment identifier when the end of an element is parsed.

Parameters:
namespaceURI - the namespace of the element
lName - the local name of the element
qName - the qname of the element
attrs - the attributes of the element
Throws:
XBRLException

processFragment

void processFragment(Fragment fragment,
                     Attributes attrs)
                     throws XBRLException
Set up the fragment index, handle ID metadata for the fragment and add it to the loader.

Parameters:
fragment - The fragment that has been identified.
attrs - The attributes of the root element of the fragment.
Throws:
XBRLException

getContentHandler

ContentHandler getContentHandler()
Returns:
the SAX content handler using the fragment identifier.

setContentHandler

void setContentHandler(ContentHandler contentHandler)
                       throws XBRLException
Parameters:
contentHandler - The content handler using the fragment identifier.
Throws:
XBRLException - if the content handler is null.

getLoader

Loader getLoader()
Returns:
the loader that is using the content handler that uses this fragment identifier.

getElementState

ElementState getElementState()
Returns:
the element state for the element currently being parsed.

Get Java XBRL API implementation at SourceForge.net.