public class Mapper extends MapperBase implements MapperFileSaveInterface
Modifier and Type | Class and Description |
---|---|
static class |
Mapper.PeriodMapping
This is a simple grouping class that is used for packaging information about how to map
an XBRLPeriod to information inside the configuration files in order to translate
the Periods into generic mappings for reuse over time.
|
Constructor and Description |
---|
Mapper(java.net.URI configFile,
DTSLoadingBarInterface bar)
Creates a mapping engine object.
|
Mapper(java.net.URI configFile,
DTSLoadingBarInterface bar,
java.util.Properties dtsProperties)
Creates a mapping engine object.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
static MapperFileSaveInterface |
createConfigFile(XBRLInstance instance,
java.net.URI config,
java.net.URI configConfUri,
java.lang.String scheme,
java.lang.String company,
java.util.ArrayList<Mapper.PeriodMapping> mappingPeriods,
XBRLDataSource dataSource)
This function generates a sample configuration file for a given DTS.
|
XBRLInstance |
generateInstance(java.lang.Object[] inputs)
Generates a new instance document obtaining data from data sources and using the
information in the configuration file.
|
XBRLInstance |
generateInstance(java.lang.Object[] inputs,
DTSLoadingBarInterface bar,
XBRLValidationReport mapReport)
Generates a new instance document obtaining data from data sources and using the
information in the configuration file.
|
XBRLInstance |
generateInstance(java.lang.Object[] inputs,
XBRLValidationReport mapReport)
Generates a new instance document obtaining data from data sources and using the
information in the configuration file.
|
java.util.Iterator<MapperFact> |
getChildrenFacts()
Access to facts on the configuration file.
|
int |
getChildrenFactsCount()
Returns the number of facts.
|
DTSContainer |
getContainer()
Access to the surrounding DTSContainer of this Mapper instance.
|
java.lang.String[] |
getDtsURLs()
Gets the dts urls.
|
java.net.URI |
getUriOfConfigFile()
Gets the uri of config file.
|
MapVersion |
getVersion()
Gets the version.
|
java.util.Collection<MapperWarningMessage> |
getWarnings()
In case there where duplicates in the map identifiers warning messages are generated.
|
void |
migrateConfigFile(XBRLInstance versioningReport,
java.net.URI outputReportUri,
java.net.URI newConfigFileUri)
Migrates a mapping configuration file to a new release of a DTS
Produces a XHTML file in the given URI with information about the
migration process.
|
void |
removeUnassignedFacts()
This method removes from the loaded xbrlt template file all entries that
has been mapped to an XBRLDataSource but the targer XBRLDataSource contains
no further information about the fact map identifier.
|
void |
save()
Stores the content of this configuration file on disk using the uriOfConfigFile.
|
void |
save(DTSLoadingBarInterface bar)
Stores the content of this configuration file on disk using
the uriOfConfigFile.
|
static void |
save(MapperFileSaveInterface mapperFileSave)
Save the Mapper configuration file to disk using the file name
assigned with a call to
setUriOfConfigFile(URI) . this method rebuilds
the entire configuration file from the object model. |
static void |
save(MapperFileSaveInterface mapperFileSave,
DTSLoadingBarInterface bar)
Save the Mapper configuration file to disk using the file name
assigned with a call to
setUriOfConfigFile(URI) . this method rebuilds
the entire configuration file from the object model. |
void |
setUriOfConfigFile(java.net.URI newURI)
Changes or sets this URI new config file.
|
addContext, addContext, addFact, addFactAt, addMapperId, addSection, addSource, addUnit, addUnit, addWarning, checkDuplicates, createEmptyMapperDoc, delContext, delFact, delSection, delUnit, getAllFactsForElement, getAllMapIdentifiersForElement, getCompany, getContextById, getContexts, getContextsKeys, getFactFromMapIdentifier, getKeyForSource, getMapIdentifierForElement, getMapperDoc, getNewMapIdentifier, getScheme, getSectionForKey, getSections, getSourceForKey, getSourceKeys, getUnitById, getUnitForKey, getUnitKeys, setCompany, setMapperDoc, setScheme
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCompany, getContextById, getContexts, getContextsKeys, getMapperDoc, getScheme, getSections, getSourceForKey, getSourceKeys, getUnitForKey, getUnitKeys
public Mapper(java.net.URI configFile, DTSLoadingBarInterface bar) throws MapConfigurationFileException
Typically, next call to the engine will be to the generateInstance method
Mappers are created by the MapEngine. Applications should not create instantiations of the Mapper out of a MapEngine for normal Mapping processing
configFile
- cannot be null and must refer to an existing template filebar
- DTSLoadingBarInterfaceMapConfigurationFileException
- the map configuration file exceptionpublic Mapper(java.net.URI configFile, DTSLoadingBarInterface bar, java.util.Properties dtsProperties) throws MapConfigurationFileException
Typically, next call to the engine will be to the generateInstance(Object[])
method
Mappers are created by the MapEngine. Applications should not create instantiations of the Mapper out of a MapEngine for normal Mapping processing
configFile
- cannot be null and must refer to an existing template filebar
- DTSLoadingBarInterfacedtsProperties
- properties for the dts configuration fileMapConfigurationFileException
- the map configuration file exceptionpublic static MapperFileSaveInterface createConfigFile(XBRLInstance instance, java.net.URI config, java.net.URI configConfUri, java.lang.String scheme, java.lang.String company, java.util.ArrayList<Mapper.PeriodMapping> mappingPeriods, XBRLDataSource dataSource) throws XBRLSerializationException, MapConfigurationFileException
Facts are not required in the incoming instance document. They will be read from the DTS. But if the instance contains facts then only facts from the instance will be included in the output template file.
XBRL Dimensions
Prior to 03/02/2011 (Version 2.7), this method did not use XBRL Dimensions. Only plain XBRL 2.1 template files was generated. Now, this method is able to obtain dimensions from the DTS applicable to each fact item in the DTS. If the primary item contains dimensions a new context is created and dimensions are added according to one of the hypercubes selected from the definition linkbase. Please bear in mind that:
instance
- an XBRL Instance. May be an empty instance just with the DTS elements (schemaRef and linkbaseRef)config
- URI of the template fileconfigConfUri
- if the mapper driver requires a configuration file this is the URI of the mapper driver configuration file. Otherwise this is null.scheme
- String for the scheme in contexts that uses "_" in the schemecompany
- String for company name in contexts that uses "_" in the identifiermappingPeriods
- array of PeriodMapping instances. This array will be used to match periods in the XBRL instance with the corresponding period in the instance template (Note they are not the same because the Period in the instance template allow for some variable substitution and formula processing of the dates).dataSource
- an instance of the XBRLDataSource class whose class name will be used as the first and unique source of data on this template file. If null then VoidDataSource will be used.XBRLSerializationException
- the XBRL serialization exceptionMapConfigurationFileException
- the map configuration file exceptionpublic DTSContainer getContainer()
Access to this property is provided in order to let the external tools like the Mapper Task Pane to access to the DTS content and properly work with it inside Excel.
getContainer
in interface MapperFileSaveInterface
public void setUriOfConfigFile(java.net.URI newURI)
newURI
- URIpublic void migrateConfigFile(XBRLInstance versioningReport, java.net.URI outputReportUri, java.net.URI newConfigFileUri)
Produces a XHTML file in the given URI with information about the migration process.
This function does not override old configuration file. It creates a new configuration file instead.
versioningReport
- XBRLInstance the versioning report where information about the two DTSs existsoutputReportUri
- URI the XHTML file generated by this processnewConfigFileUri
- URI the new configuration filepublic void save(DTSLoadingBarInterface bar) throws XBRLSerializationException, MapConfigurationFileException
bar
- DTSLoadingBarInterface to produce messages and progress informationXBRLSerializationException
- the XBRL serialization exceptionMapConfigurationFileException
- the map configuration file exceptionpublic void save() throws XBRLSerializationException, MapConfigurationFileException
XBRLSerializationException
- the XBRL serialization exceptionMapConfigurationFileException
- the map configuration file exceptionpublic static void save(MapperFileSaveInterface mapperFileSave) throws XBRLSerializationException
setUriOfConfigFile(URI)
. this method rebuilds
the entire configuration file from the object model.
All the information to store in the configuration file will be
obtained from the parameter MapperFileSaveInterface
. Note that
a call to createConfigFile(XBRLInstance, URI, URI, String, String, ArrayList, XBRLDataSource)
already
returns an instance of that class. A Mapper
instance also implements that interface.
mapperFileSave
- the mapper file saveXBRLSerializationException
- the XBRL serialization exceptionpublic static void save(MapperFileSaveInterface mapperFileSave, DTSLoadingBarInterface bar) throws XBRLSerializationException
setUriOfConfigFile(URI)
. this method rebuilds
the entire configuration file from the object model.
All the information to store in the configuration file will be
obtained from the parameter MapperFileSaveInterface
. Note that
a call to createConfigFile(XBRLInstance, URI, URI, String, String, ArrayList, XBRLDataSource)
already
returns an instance of that class. A Mapper
instance also implements that interface.
mapperFileSave
- the class instance implementing MapperFileSaveInterface interfacebar
- the DTSLoadingBarInterface instance to report progress and messagesXBRLSerializationException
- the XBRL serialization exceptionpublic java.util.Collection<MapperWarningMessage> getWarnings()
public void removeUnassignedFacts()
The algorithm used to detect if the fact is not used requires the driver implements the interface XBRLDataSourceMapIdInUse. The algorithm used is as follows:
public XBRLInstance generateInstance(java.lang.Object[] inputs, XBRLValidationReport mapReport) throws MapException
If mapReport not is null, at the end it will contain all the problems encountered during the import. If mapReport is null, the process will stop when it encounters the first problem encountered during the import.
The new instance document is returned
inputs
- input parameters to the XBRLDataSourcesmapReport
- the optional mapper reportMapException
- the map exceptionpublic XBRLInstance generateInstance(java.lang.Object[] inputs) throws MapException
inputs
- input parameters to the XBRLDataSourcesMapException
- the map exceptionpublic XBRLInstance generateInstance(java.lang.Object[] inputs, DTSLoadingBarInterface bar, XBRLValidationReport mapReport) throws MapException
If mapReport not is null, at the end it will contain all the problems encountered during the import. If mapReport is null, the process will stop when it encounters the first problem encountered during the import.
The new instance document is returned
inputs
- input parameters to the XBRLDataSourcesbar
- instance of DTSLoadingBarInterface or null if not requiredmapReport
- the optional mapper reportMapException
- the map exceptionpublic MapVersion getVersion()
getVersion
in class MapperBase
public java.net.URI getUriOfConfigFile()
getUriOfConfigFile
in interface MapperFileSaveInterface
public java.lang.String[] getDtsURLs()
getDtsURLs
in interface MapperFileSaveInterface
public java.util.Iterator<MapperFact> getChildrenFacts()
MapperFileSaveInterface
getChildrenFacts
in interface MapperFileSaveInterface
public int getChildrenFactsCount()
MapperFileSaveInterface
getChildrenFactsCount
in interface MapperFileSaveInterface
public void clear() throws java.lang.Throwable
clear
in class MapperBase
java.lang.Throwable
Copyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa