com.ihr.xbrl.mapper.instance
Class MapperPeriodBase

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.mapper.instance.MapperPeriodBase
All Implemented Interfaces:
MapperPeriod, XBRLRelationshipPoint, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
Direct Known Subclasses:
MapperPeriod2, MapperPeriod3

public abstract class MapperPeriodBase
extends XMLFragment
implements MapperPeriod

Author:
Ignacio

Field Summary
static int DATE_END
          Constant to refer to the END date or datetime of this period
static int DATE_INSTANT
          Constant to refer to the INSTANT date or datetime of this period
static int DATE_START
          Constant to refer to the START date or datetime of this period
static javax.xml.namespace.QName periodNode
          Constant xbrli:period used during serialization of periods
 
Fields inherited from class com.ihr.xbrl.om.XMLFragment
CONCEPT_LABEL, CONCEPT_QNAME, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, idQName, NO_POSITION, OrderComparator, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER
 
Constructor Summary
MapperPeriodBase(DTSContainer dts)
           
MapperPeriodBase(DTSContainer dts, net.sf.saxon.s9api.XdmNode node)
           
MapperPeriodBase(MapperPeriodBase other)
          Creates an new period as a copy of the current period.
MapperPeriodBase(XBRLPeriod period)
           
 
Method Summary
abstract  MapperPeriodBase clone()
           
 boolean equals(java.lang.Object other)
          Sets a new XPathFunctionResolver for this object
 org.jdom.Element generateNode(boolean relativize, java.net.URI base)
          Serializes to a jdom Element the representation of the properties of this Information Item This method should be called from classes derived from this class
 java.lang.String getDate(int type, boolean operate)
          String representation of the date in the period. adjusted according to XBRL specification rules.
 java.util.Iterator<XMLFragment> getElements()
          For complex type resources this returns an iterator with all children XML fragments Tthis method may be overwriten by other classes in the hierarchy
 java.util.GregorianCalendar getGregorianCalendarDate(int type)
          Returns the value of the date for the type requested.
 XBRLItem.PeriodType getPeriodType()
          Returns XBRLItem.DURATION or XBRLItem.INSTANT depending on the context period information.
 java.lang.String getRawDate(int type, boolean operate)
          String representation of the date in the period.
 java.util.Date getRawDateUtil(int code)
          Returns the raw date (the one specified by syntax) in the context.
 java.util.GregorianCalendar getRawGregorianCalendarDate(int type)
          Returns the value of the date for the type requested.
 XBRLPeriod getXBRLPeriod()
           
 int hashCode()
           
 boolean isDuration()
           
 boolean isForever()
           
 boolean isInstant()
           
 boolean isMacroPeriod()
          Returns true only if the period content is a string of text that can be evaluated as a macro
 void setDate(int type, java.lang.String strDate)
          Sets the value of the specified field
 java.lang.String toString()
          Returns the XML representation of this object as an String
 
Methods inherited from class com.ihr.xbrl.om.XMLFragment
addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clear, clone, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAttribute, getAttributeQNameValue, getAttributes, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getFragment, getFriendlyName, getFriendlyName, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParent, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setId, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setValue, setValue, setVariablesDefined, valueEquals, xEqual
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

periodNode

public static final javax.xml.namespace.QName periodNode
Constant xbrli:period used during serialization of periods


DATE_INSTANT

public static final int DATE_INSTANT
Constant to refer to the INSTANT date or datetime of this period

See Also:
Constant Field Values

DATE_START

public static final int DATE_START
Constant to refer to the START date or datetime of this period

See Also:
Constant Field Values

DATE_END

public static final int DATE_END
Constant to refer to the END date or datetime of this period

See Also:
Constant Field Values
Constructor Detail

MapperPeriodBase

public MapperPeriodBase(DTSContainer dts)
Parameters:
dts -
node -

MapperPeriodBase

public MapperPeriodBase(DTSContainer dts,
                        net.sf.saxon.s9api.XdmNode node)
Parameters:
dts -
node -

MapperPeriodBase

public MapperPeriodBase(MapperPeriodBase other)
Creates an new period as a copy of the current period. This is the constructor used by clone() method but make public for convenience

Parameters:
other - XBRLPeriod

MapperPeriodBase

public MapperPeriodBase(XBRLPeriod period)
Parameters:
period -
Method Detail

clone

public abstract MapperPeriodBase clone()
Specified by:
clone in interface MapperPeriod
Overrides:
clone in class XMLFragment

generateNode

public org.jdom.Element generateNode(boolean relativize,
                                     java.net.URI base)
                              throws XBRLSerializationException
Description copied from class: XMLFragment
Serializes to a jdom Element the representation of the properties of this Information Item This method should be called from classes derived from this class

Specified by:
generateNode in interface MapperPeriod
Overrides:
generateNode in class XMLFragment
Parameters:
relativize - boolean indicating if URIs should be relativized to the base URI (see next argument)
base - the URI to which some attributes of this object should be relativided
Returns:
a clone of the surrounding jdom Element so it can be incorporated into multiple trees
Throws:
XBRLSerializationException

getPeriodType

public XBRLItem.PeriodType getPeriodType()
Returns XBRLItem.DURATION or XBRLItem.INSTANT depending on the context period information. Forever periods are considered DURATION.

Specified by:
getPeriodType in interface MapperPeriod
Returns:
int

isInstant

public boolean isInstant()
Specified by:
isInstant in interface MapperPeriod
Returns:
true if this period is of the XBRL instant type

isDuration

public boolean isDuration()
Specified by:
isDuration in interface MapperPeriod
Returns:
true if this period is of the XBRL duration type. Forever periods are duration

isMacroPeriod

public boolean isMacroPeriod()
Returns true only if the period content is a string of text that can be evaluated as a macro

Specified by:
isMacroPeriod in interface MapperPeriod
Returns:
boolean

isForever

public boolean isForever()
Specified by:
isForever in interface MapperPeriod
Returns:
true if this period is forever

getDate

public java.lang.String getDate(int type,
                                boolean operate)
String representation of the date in the period. adjusted according to XBRL specification rules. That is, adding 24 hours to period end and instant dates and keeping the date on period start dates.

Specified by:
getDate in interface MapperPeriod
Parameters:
type - code indicating what to obtain. DATE_INSTANT, DATE_START or DATE_END
Returns:
String

getRawDate

public java.lang.String getRawDate(int type,
                                   boolean operate)
String representation of the date in the period. NOT adjusted according to XBRL specification rules. That is, not adding 24 hours to any date

Specified by:
getRawDate in interface MapperPeriod
Parameters:
type - code indicating what to obtain. DATE_INSTANT, DATE_START or DATE_END
Returns:
String

getGregorianCalendarDate

public java.util.GregorianCalendar getGregorianCalendarDate(int type)
Returns the value of the date for the type requested. returned values are adjusted according to XBRL specification rules Valid types are: XBRLPeriod.DATE_END XBRLPeriod.DATE_START XBRLPeriod.DATE_INSTANT

Specified by:
getGregorianCalendarDate in interface MapperPeriod
Parameters:
type - one of the constants below
Returns:
a GregorianCalendar

getRawGregorianCalendarDate

public java.util.GregorianCalendar getRawGregorianCalendarDate(int type)
Returns the value of the date for the type requested. NOT adjusted to XBRL interpretation. returned values are NOT adjusted according to XBRL specification rules Valid types are: XBRLPeriod.DATE_END XBRLPeriod.DATE_START XBRLPeriod.DATE_INSTANT

Specified by:
getRawGregorianCalendarDate in interface MapperPeriod
Parameters:
type - one of the constants below
Returns:
a GregorianCalendar

setDate

public void setDate(int type,
                    java.lang.String strDate)
             throws XBRLValidationException
Sets the value of the specified field

Specified by:
setDate in interface MapperPeriod
Parameters:
type - this is the field, DATE_END, DATE_INSTANT, DATE_START
strDate - iso8601 date string
Throws:
XBRLValidationException

getRawDateUtil

public java.util.Date getRawDateUtil(int code)
Returns the raw date (the one specified by syntax) in the context. "raw" means no +1PD will be assumed for instance dates or endDate dates The return value is a Date in this case.

Specified by:
getRawDateUtil in interface MapperPeriod
Parameters:
code - this is the field, DATE_END, DATE_INSTANT, DATE_START
Returns:
a java.util.Date

toString

public java.lang.String toString()
Description copied from class: XMLFragment
Returns the XML representation of this object as an String

Specified by:
toString in interface MapperPeriod
Overrides:
toString in class XMLFragment

getElements

public java.util.Iterator<XMLFragment> getElements()
Description copied from class: XMLFragment
For complex type resources this returns an iterator with all children XML fragments Tthis method may be overwriten by other classes in the hierarchy

Specified by:
getElements in interface MapperPeriod
Overrides:
getElements in class XMLFragment
Returns:
Iterator

getXBRLPeriod

public XBRLPeriod getXBRLPeriod()
Specified by:
getXBRLPeriod in interface MapperPeriod
Returns:
XBRLPeriod

equals

public boolean equals(java.lang.Object other)
Description copied from class: XMLFragment
Sets a new XPathFunctionResolver for this object

Specified by:
equals in interface MapperPeriod
Overrides:
equals in class XMLFragment

hashCode

public int hashCode()
Specified by:
hashCode in interface MapperPeriod
Overrides:
hashCode in class XMLFragment


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