EXIficient

com.siemens.ct.exi.helpers
Class DefaultEXIFactory

java.lang.Object
  extended by com.siemens.ct.exi.helpers.DefaultEXIFactory
All Implemented Interfaces:
EXIFactory

public class DefaultEXIFactory
extends java.lang.Object
implements EXIFactory

This is the default implementation of an EXIFactory class.

Version:
0.3.20090331
Author:
Daniel.Peintner.EXT@siemens.com, Joerg.Heuer@siemens.com
See Also:
EXIFactory

Method Summary
 DecoderBlock createDecoderBlock(java.io.InputStream inputStream)
          Returns an EXI DecoderBlock according coding options like CodingMode etc.
 EncoderBlock createEncoderBlock(java.io.OutputStream outputStream)
          Returns an EXI EncoderBlock according coding options like CodingMode etc.
 EXIDecoder createEXIDecoder()
          Returns an EXIDecoder
 EXIEncoder createEXIEncoder()
          Returns an EXIEncoder
 org.xml.sax.XMLReader createEXIReader()
          Returns an EXIReader
 EXIWriter createEXIWriter()
          Returns an EXIWriter
 TypeDecoder createTypeDecoder()
          Returns an EXI TypeDecoder according coding options such as schema-informed or schema-less grammar and options like Preserve.LexicalValues
 TypeEncoder createTypeEncoder()
          Returns an EXI TypeEncoder according coding options such as schema-informed or schema-less grammar and options like Preserve.LexicalValues
 CodingMode getCodingMode()
          Returns the currently used CodingMode.
 FidelityOptions getFidelityOptions()
          Returns the fidelity options used by the EXI factory (e.g. preserving XML comments or DTDs).
 Grammar getGrammar()
          Returns the currently used EXI Grammar.
 boolean isEXIBodyOnly()
           
 boolean isFragment()
          Returns whether we deal with a fragment
static EXIFactory newInstance()
           
 void setCodingMode(CodingMode codingMode)
          Re-sets the coding mode used by the factory.
 void setDatatypeRepresentationMap(DatatypeRepresentation[] datatypeRepresentations)
          By default, each typed value in an EXI stream is represented by the associated built-in EXI datatype representation.
 void setEXIBodyOnly(boolean exiBodyOnly)
          Sets whether an EXI Body is preceded by an EXI Header.
 void setFidelityOptions(FidelityOptions fidelityOptions)
          Sets the fidelity options used by the EXI factory (e.g. preserving XML comments or DTDs).
 void setFragment(boolean isFragment)
          Informs the factory that we are dealing with an XML fragment instead of an XML document
 void setGrammar(Grammar grammar)
          Sets the EXI Grammar used for coding.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static EXIFactory newInstance()

setFidelityOptions

public void setFidelityOptions(FidelityOptions fidelityOptions)
Description copied from interface: EXIFactory
Sets the fidelity options used by the EXI factory (e.g. preserving XML comments or DTDs).

Specified by:
setFidelityOptions in interface EXIFactory
Parameters:
fidelityOptions - new fidelity options
See Also:
FidelityOptions

getFidelityOptions

public FidelityOptions getFidelityOptions()
Description copied from interface: EXIFactory
Returns the fidelity options used by the EXI factory (e.g. preserving XML comments or DTDs).

Specified by:
getFidelityOptions in interface EXIFactory
Returns:
fidelity options currently used by the factory
See Also:
FidelityOptions

setDatatypeRepresentationMap

public void setDatatypeRepresentationMap(DatatypeRepresentation[] datatypeRepresentations)
Description copied from interface: EXIFactory
By default, each typed value in an EXI stream is represented by the associated built-in EXI datatype representation. However, EXI processors MAY provide the capability to specify different built-in EXI datatype representations or user-defined datatype representations for representing specific schema datatypes. This capability is called Datatype Representation Map.

Specified by:
setDatatypeRepresentationMap in interface EXIFactory

setGrammar

public void setGrammar(Grammar grammar)
Description copied from interface: EXIFactory
Sets the EXI Grammar used for coding.

Specified by:
setGrammar in interface EXIFactory

getGrammar

public Grammar getGrammar()
Description copied from interface: EXIFactory
Returns the currently used EXI Grammar. By default a SchemaLessGrammar is used.

Specified by:
getGrammar in interface EXIFactory
Returns:
grammar used by the factory

setFragment

public void setFragment(boolean isFragment)
Description copied from interface: EXIFactory
Informs the factory that we are dealing with an XML fragment instead of an XML document

Specified by:
setFragment in interface EXIFactory

isFragment

public boolean isFragment()
Description copied from interface: EXIFactory
Returns whether we deal with a fragment

Specified by:
isFragment in interface EXIFactory
Returns:
is fragment

setCodingMode

public void setCodingMode(CodingMode codingMode)
Description copied from interface: EXIFactory
Re-sets the coding mode used by the factory.

Specified by:
setCodingMode in interface EXIFactory

getCodingMode

public CodingMode getCodingMode()
Description copied from interface: EXIFactory
Returns the currently used CodingMode. By default BIT_PACKED is used.

Specified by:
getCodingMode in interface EXIFactory
Returns:
coding-mode used by the factory

setEXIBodyOnly

public void setEXIBodyOnly(boolean exiBodyOnly)
Description copied from interface: EXIFactory
Sets whether an EXI Body is preceded by an EXI Header. By default any EXI stream consists of an EXI header followed by an EXI Body. e.g. SelfContained Fragments are treated differently and no additional header is added.

Specified by:
setEXIBodyOnly in interface EXIFactory

isEXIBodyOnly

public boolean isEXIBodyOnly()
Specified by:
isEXIBodyOnly in interface EXIFactory

createEXIEncoder

public EXIEncoder createEXIEncoder()
Description copied from interface: EXIFactory
Returns an EXIEncoder

Specified by:
createEXIEncoder in interface EXIFactory
Returns:
encoder using the previously set coding options.

createEXIWriter

public EXIWriter createEXIWriter()
Description copied from interface: EXIFactory
Returns an EXIWriter

Specified by:
createEXIWriter in interface EXIFactory
Returns:
writer using the previously set coding options.

createEXIDecoder

public EXIDecoder createEXIDecoder()
Description copied from interface: EXIFactory
Returns an EXIDecoder

Specified by:
createEXIDecoder in interface EXIFactory
Returns:
decoder using the previously set coding options.

createEXIReader

public org.xml.sax.XMLReader createEXIReader()
Description copied from interface: EXIFactory
Returns an EXIReader

Specified by:
createEXIReader in interface EXIFactory
Returns:
reader using the previously set coding options.

createTypeEncoder

public TypeEncoder createTypeEncoder()
Description copied from interface: EXIFactory
Returns an EXI TypeEncoder according coding options such as schema-informed or schema-less grammar and options like Preserve.LexicalValues

Specified by:
createTypeEncoder in interface EXIFactory
Returns:
type encoder according given EXI options
See Also:
TypeEncoder

createTypeDecoder

public TypeDecoder createTypeDecoder()
Description copied from interface: EXIFactory
Returns an EXI TypeDecoder according coding options such as schema-informed or schema-less grammar and options like Preserve.LexicalValues

Specified by:
createTypeDecoder in interface EXIFactory
Returns:
type decoder according given EXI options
See Also:
TypeDecoder

createEncoderBlock

public EncoderBlock createEncoderBlock(java.io.OutputStream outputStream)
Description copied from interface: EXIFactory
Returns an EXI EncoderBlock according coding options like CodingMode etc.

Specified by:
createEncoderBlock in interface EXIFactory
Returns:
encoder block according given EXI options
See Also:
EncoderBlock

createDecoderBlock

public DecoderBlock createDecoderBlock(java.io.InputStream inputStream)
                                throws java.io.IOException
Description copied from interface: EXIFactory
Returns an EXI DecoderBlock according coding options like CodingMode etc.

Specified by:
createDecoderBlock in interface EXIFactory
Returns:
decoder block according given EXI options
Throws:
java.io.IOException
See Also:
DecoderBlock

EXIficient