com.ihr.xbrl.pojo
Class XBRLPojoGenerator

java.lang.Object
  extended by com.ihr.xbrl.pojo.XBRLPojoGenerator

public class XBRLPojoGenerator
extends java.lang.Object

Generates a POJO version of any other RS object version and recursively do the same for all required objects. For example, the generation of a com.ihr.xbrl.om.instance.XBRLInstance object will also convert the DTS objects, including the taxonomy, namespaces, linkbases, contexts etc etc.

If the conversion is launched for the storage of the object in a permanent repository then it is required to set up this generator with a session object that will be used for storing the data in the database.
if the session is not set then the conversion cannot be stored in a database but can be used for any other purposes.

Author:
Ignacio

Field Summary
static java.lang.String EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD
          The EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD property indicates how the content "nodes" of an XBRL Document already loaded from an external web site is going to be transformed into a sequence of bytes for storage into the content of the DOCUMENTS table.
static java.lang.String READSOURCE
          This is another possible value for the EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD property
static java.lang.String SERIALIZE
          This is the default value for the EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD property
 
Constructor Summary
XBRLPojoGenerator()
           
XBRLPojoGenerator(java.util.Properties props)
           
 
Method Summary
 DTSContainer generate(DTSContainer dts)
          Generates a POJO version of the non POJO DTSContainer
 Namespace generate(org.jdom.Namespace ns)
           
 QName generate(javax.xml.namespace.QName q)
           
 XBRLHasDocumentation generate(XBRLAllowsDocumentation parent)
           
 XBRLArcroleType generate(XBRLArcroleType dtsArcroleType)
           
 XMLAttribute generate(XBRLAttribute dtsAtt)
           
 XBRLContext generate(XBRLContext context)
           
 XBRLDocument generate(XBRLDocument dtsDoc)
           
 XBRLDocumentation generate(XBRLDocumentation dtsDoc)
           
 XBRLEntity generate(XBRLEntity entity)
           
 XBRLExtendedLink generate(XBRLExtendedLink dtsExtLink)
           
 XBRLFact generate(XBRLFact fact)
           
 XBRLFactItem generate(XBRLFactItem fact)
           
 XBRLFactString generate(XBRLFactNonNumeric fact)
           
 XBRLFactNumeric generate(XBRLFactNumeric fact)
           
 XBRLFactList generate(XBRLFactsList list)
          FactList is an interface so generate the appropriate class
 XBRLFactTuple generate(XBRLFactTuple fact)
           
 XBRLImport generate(XBRLImport dtsImport)
           
 XBRLInstance generate(XBRLInstance instance)
           
 XBRLInstance generate(XBRLInstance instance, boolean bForUpdate)
          Generates a new pojo instance document based on the content of the instance document submitted as a parameter.
 XBRLInstance generate(XBRLInstance instance, boolean bForUpdate, java.lang.String pathConversionRule)
          Generates a new pojo instance document based on the content of the instance document submitted as a parameter.
 XBRLItem generate(XBRLItem dtsItem)
           
 XBRLLinkbase generate(XBRLLinkbase dtsLinkbase)
           
 XBRLPeriod generate(XBRLPeriod period)
           
 XBRLRelationship generate(XBRLRelationship dtsRel)
           
 XBRLResource generate(XBRLResource dtsRes)
           
 XBRLRoleArcroleType generate(XBRLRoleAndArcroleTypes parent)
           
 XBRLRoleType generate(XBRLRoleType dtsRoleType)
           
 XBRLScenario generate(XBRLScenario scenario)
           
 XBRLSegment generate(XBRLSegment segment)
           
 XBRLTaxonomy generate(XBRLTaxonomy dtsTaxonomy)
           
 XBRLTuple generate(XBRLTuple dtsTuple)
           
 XBRLUnit generate(XBRLUnit unit)
           
 XBRLUsedOn generate(XBRLUsedOn dtsOn)
           
 XMLFragment generate(XMLFragment node)
           
 int getObjectsCount()
           
 java.lang.String getStatistics()
           
 void registerBar(DTSLoadingBarInterface bar)
           
 void setSession(org.hibernate.Session session, DbUtil.Database databaseType)
          Sets the session with the database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD

public static final java.lang.String EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD
The EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD property indicates how the content "nodes" of an XBRL Document already loaded from an external web site is going to be transformed into a sequence of bytes for storage into the content of the DOCUMENTS table. Possible values are:

serialize: this is the default value. Means, the API will generate a new XBRLDocument (Taxonomy or Linkbase) from the original content. The new file will be semantically equivalent to the original one (same content) but may not be syntactically equal. The generation will always success because the document has been already loaded and validated. The generation is faster than obtaining it fron an external web site.

readsource: this will open a new http connection to the external web site and will read the content again from the original location.

See Also:
Constant Field Values

SERIALIZE

public static final java.lang.String SERIALIZE
This is the default value for the EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD property

See Also:
#EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD}, Constant Field Values

READSOURCE

public static final java.lang.String READSOURCE
This is another possible value for the EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD property

See Also:
#EXTERNAL_FILES_DOCUMENT_CONTENT_METHOD}, Constant Field Values
Constructor Detail

XBRLPojoGenerator

public XBRLPojoGenerator()

XBRLPojoGenerator

public XBRLPojoGenerator(java.util.Properties props)
Method Detail

generate

public XBRLInstance generate(XBRLInstance instance)
                      throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public XBRLInstance generate(XBRLInstance instance,
                             boolean bForUpdate)
                      throws XBRLPojoGenerationException
Generates a new pojo instance document based on the content of the instance document submitted as a parameter. the variable bForUpdate may have two values: true, means that a new pojo will be created from the content of the instance regardless an instance already exist in the database. If a new instance exist in the database that instance will be updated. If bForUpdate is false then if an existing instance is in the database for the given document URI (key) then the document in the database is returned.

Parameters:
instance - RS Object model XBRL instance
bForUpdate - boolean
Returns:
instance in the POJO object model
Throws:
XBRLPojoGenerationException

generate

public XBRLInstance generate(XBRLInstance instance,
                             boolean bForUpdate,
                             java.lang.String pathConversionRule)
                      throws XBRLPojoGenerationException
Generates a new pojo instance document based on the content of the instance document submitted as a parameter. the variable bForUpdate may have two values: true, means that a new pojo will be created from the content of the instance regardless an instance already exist in the database. If a new instance exist in the database that instance will be updated. If bForUpdate is false then if an existing instance is in the database for the given document URI (key) then the document in the database is returned.

Parameters:
instance - RS Object model XBRL instance
bForUpdate - boolean
Returns:
instance in the POJO object model
Throws:
XBRLPojoGenerationException

generate

public XBRLFactList generate(XBRLFactsList list)
                      throws XBRLPojoGenerationException
FactList is an interface so generate the appropriate class

Parameters:
list -
Returns:
XBRLFactList
Throws:
XBRLPojoGenerationException

generate

public XBRLFact generate(XBRLFact fact)
                  throws XBRLPojoGenerationException
Parameters:
fact -
Returns:
XBRLFact
Throws:
XBRLPojoGenerationException

generate

public XBRLFactItem generate(XBRLFactItem fact)
                      throws XBRLPojoGenerationException
Parameters:
fact -
Returns:
XBRLFactItem
Throws:
XBRLPojoGenerationException

generate

public XBRLFactTuple generate(XBRLFactTuple fact)
                       throws XBRLPojoGenerationException
Parameters:
fact -
Returns:
XBRLFactTuple
Throws:
XBRLPojoGenerationException

generate

public XBRLFactString generate(XBRLFactNonNumeric fact)
                        throws XBRLPojoGenerationException
Parameters:
fact -
Returns:
XBRLFactString
Throws:
XBRLPojoGenerationException

generate

public XBRLFactNumeric generate(XBRLFactNumeric fact)
                         throws XBRLPojoGenerationException
Parameters:
fact -
Returns:
XBRLFactNumeric
Throws:
XBRLPojoGenerationException

generate

public XBRLUnit generate(XBRLUnit unit)
Parameters:
unit -
Returns:
XBRLUnit pojo

generate

public XBRLContext generate(XBRLContext context)
                     throws XBRLPojoGenerationException
Parameters:
context -
Returns:
XBRLContext
Throws:
XBRLPojoGenerationException

generate

public XBRLScenario generate(XBRLScenario scenario)
                      throws XBRLPojoGenerationException
Parameters:
scenario -
Returns:
XBRLScenario
Throws:
XBRLPojoGenerationException

generate

public XBRLPeriod generate(XBRLPeriod period)
Parameters:
period -
Returns:
XBRLPeriod

generate

public XBRLEntity generate(XBRLEntity entity)
                    throws XBRLPojoGenerationException
Parameters:
entity -
Returns:
XBRLEntity
Throws:
XBRLPojoGenerationException

generate

public XBRLSegment generate(XBRLSegment segment)
                     throws XBRLPojoGenerationException
Parameters:
segment -
Returns:
XBRLSegment
Throws:
XBRLPojoGenerationException

generate

public DTSContainer generate(DTSContainer dts)
                      throws XBRLPojoGenerationException
Generates a POJO version of the non POJO DTSContainer

Parameters:
dts - Regular, non POJO, DTS Container
Returns:
DTSContainer
Throws:
XBRLPojoGenerationException

generate

public XBRLItem generate(XBRLItem dtsItem)
                  throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public QName generate(javax.xml.namespace.QName q)
Parameters:
q - QName
Returns:
QName pojo

generate

public Namespace generate(org.jdom.Namespace ns)
Parameters:
ns -
Returns:
Namespace pojo

generate

public XMLAttribute generate(XBRLAttribute dtsAtt)
                      throws XBRLPojoGenerationException
Parameters:
dtsAtt -
Returns:
XMLAttribute
Throws:
XBRLPojoGenerationException

generate

public XBRLTuple generate(XBRLTuple dtsTuple)
                   throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public XBRLTaxonomy generate(XBRLTaxonomy dtsTaxonomy)
                      throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public XBRLImport generate(XBRLImport dtsImport)
                    throws XBRLPojoGenerationException
Parameters:
dtsImport -
Returns:
XBRLImport
Throws:
XBRLPojoGenerationException

generate

public XBRLResource generate(XBRLResource dtsRes)
                      throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public XBRLExtendedLink generate(XBRLExtendedLink dtsExtLink)
                          throws XBRLPojoGenerationException
Parameters:
dtsExtLink -
Returns:
XBRLExtendedLink
Throws:
XBRLPojoGenerationException

generate

public XBRLDocument generate(XBRLDocument dtsDoc)
                      throws XBRLPojoGenerationException
Parameters:
dtsDoc -
Returns:
XBRLDocument
Throws:
XBRLPojoGenerationException

generate

public XBRLRelationship generate(XBRLRelationship dtsRel)
                          throws XBRLPojoGenerationException
Parameters:
dtsRel -
Returns:
XBRLRelationship
Throws:
XBRLPojoGenerationException

generate

public XMLFragment generate(XMLFragment node)
                     throws XBRLPojoGenerationException
Parameters:
node -
Returns:
XMLFragment
Throws:
XBRLPojoGenerationException

generate

public XBRLLinkbase generate(XBRLLinkbase dtsLinkbase)
                      throws XBRLPojoGenerationException
Parameters:
dtsLinkbase -
Returns:
XBRLLinkbase
Throws:
XBRLPojoGenerationException

generate

public XBRLArcroleType generate(XBRLArcroleType dtsArcroleType)
                         throws XBRLPojoGenerationException
Parameters:
dtsArcroleType -
Returns:
XBRLArcroleType
Throws:
XBRLPojoGenerationException

generate

public XBRLRoleType generate(XBRLRoleType dtsRoleType)
                      throws XBRLPojoGenerationException
Parameters:
dtsRoleType -
Returns:
XBRLRoleType
Throws:
XBRLPojoGenerationException

generate

public XBRLDocumentation generate(XBRLDocumentation dtsDoc)
                           throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public XBRLHasDocumentation generate(XBRLAllowsDocumentation parent)
                              throws XBRLPojoGenerationException
Parameters:
parent -
Returns:
XBRLHasDocumentation
Throws:
XBRLPojoGenerationException

generate

public XBRLRoleArcroleType generate(XBRLRoleAndArcroleTypes parent)
                             throws XBRLPojoGenerationException
Throws:
XBRLPojoGenerationException

generate

public XBRLUsedOn generate(XBRLUsedOn dtsOn)
                    throws XBRLPojoGenerationException
Parameters:
dtsOn -
Returns:
XBRLUsedOn
Throws:
XBRLPojoGenerationException

registerBar

public void registerBar(DTSLoadingBarInterface bar)
Parameters:
bar -

getObjectsCount

public int getObjectsCount()

getStatistics

public java.lang.String getStatistics()

setSession

public void setSession(org.hibernate.Session session,
                       DbUtil.Database databaseType)
Sets the session with the database. If the session is set objects are created only if they don't exist in the database. If there is no session set new objects are always created

Parameters:
session - Session object to set
databaseType -


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa