INRIA & FluxMedia

fr.fluxmedia.transmorpher.engine
Class TReader

java.lang.Object
  |
  +--fr.fluxmedia.transmorpher.engine.TProcess_Impl
        |
        +--fr.fluxmedia.transmorpher.engine.TProcessBasic
              |
              +--fr.fluxmedia.transmorpher.engine.TReader
All Implemented Interfaces:
java.lang.Runnable, TProcess
Direct Known Subclasses:
ReadFile

public abstract class TReader
extends TProcessBasic

This class provide a basic process which is able to read an XML file

Since:
jdk 1.3 && SAX 2.0
Author:
Laurent.Tardif@inrialpes.fr

Field Summary
protected static boolean DEFAULT_NAMESPACES
          Default namespaces support (true).
protected static boolean DEFAULT_NAMESPACES_PREFIXES
          Default namespaces support (true).
protected static boolean DEFAULT_SCHEMA_VALIDATION
          Default Schema validation support (false).
protected static boolean DEFAULT_VALIDATION
          Default validation support (false).
 java.lang.String iFilename
          Name of the file to read
 org.xml.sax.XMLReader iReader
          The XMLReader
 boolean isRunning
          Description of the Field
protected static java.lang.String LEXICAL_HANDLER_PROPERTY_ID
          Lexical handler property id (http://xml.org/sax/properties/lexical-handler).
protected static java.lang.String NAMESPACES_FEATURE_ID
          Namespaces feature id (http://xml.org/sax/features/namespaces).
protected static java.lang.String NAMESPACES_PREFIXES_FEATURE_ID
          Namespaces feature id (http://xml.org/sax/features/namespaces).
private  java.lang.Exception raisedException
          An exception raised during thread processing
protected static java.lang.String SCHEMA_VALIDATION_FEATURE_ID
          Schema validation feature id (http://apache.org/xml/features/validation/schema).
 org.xml.sax.InputSource standardInput
           
protected static java.lang.String VALIDATION_FEATURE_ID
          Validation feature id (http://xml.org/sax/features/validation).
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.TProcessBasic
isThread, procThread, type
 
Fields inherited from class fr.fluxmedia.transmorpher.engine.TProcess_Impl
debug, id, iListIn, iListOfParameters, iListOut, iName, iNbIn, iNbOut, nameFather, nameIn, nameOut
 
Constructor Summary
TReader(java.lang.String[] pOut, Parameters pParam, StringParameters pStaticAttributes)
          Constructor for the TReader object
 
Method Summary
 void execProcess()
          Exec the process :parse a file or an URL content
 void execProcess(java.lang.String file)
          Begins the parse of a file.
 void generatePort()
          Generates port for this component
 java.lang.Exception getRaisedException()
          return eventualy raised exception during thread execution
abstract  void read()
          This is the only method a developper has to implement in order to create a new reader.
 void run()
          Main processing method for the TReader object
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.TProcessBasic
getType, setThread, setType
 
Methods inherited from class fr.fluxmedia.transmorpher.engine.TProcess_Impl
bindParameters, getFatherName, getId, getIn, getIn, getIn, getName, getNameIn, getNameIn, getNameOut, getNameOut, getOut, getOut, getOut, getParameter, getParameterNames, getParameters, reset, setDebug, setFatherName, setId, setIn, setName, setOut, setParameter, setParameters
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

NAMESPACES_FEATURE_ID

protected static final java.lang.String NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).

NAMESPACES_PREFIXES_FEATURE_ID

protected static final java.lang.String NAMESPACES_PREFIXES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).

VALIDATION_FEATURE_ID

protected static final java.lang.String VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).

SCHEMA_VALIDATION_FEATURE_ID

protected static final java.lang.String SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id (http://apache.org/xml/features/validation/schema).

LEXICAL_HANDLER_PROPERTY_ID

protected static final java.lang.String LEXICAL_HANDLER_PROPERTY_ID
Lexical handler property id (http://xml.org/sax/properties/lexical-handler).

DEFAULT_NAMESPACES

protected static final boolean DEFAULT_NAMESPACES
Default namespaces support (true).

DEFAULT_NAMESPACES_PREFIXES

protected static final boolean DEFAULT_NAMESPACES_PREFIXES
Default namespaces support (true).

DEFAULT_VALIDATION

protected static final boolean DEFAULT_VALIDATION
Default validation support (false).

DEFAULT_SCHEMA_VALIDATION

protected static final boolean DEFAULT_SCHEMA_VALIDATION
Default Schema validation support (false).

iReader

public org.xml.sax.XMLReader iReader
The XMLReader

isRunning

public boolean isRunning
Description of the Field

raisedException

private java.lang.Exception raisedException
An exception raised during thread processing

iFilename

public java.lang.String iFilename
Name of the file to read

standardInput

public org.xml.sax.InputSource standardInput
Constructor Detail

TReader

public TReader(java.lang.String[] pOut,
               Parameters pParam,
               StringParameters pStaticAttributes)
        throws org.xml.sax.SAXException,
               java.io.IOException
Constructor for the TReader object
Parameters:
pOut - Description of the Parameter
pParam - Description of the Parameter
pStaticAttributes - Description of the Parameter
Throws:
org.xml.sax.SAXException - can wrap others exceptions
java.io.IOException - if an IO operation failed
Method Detail

getRaisedException

public java.lang.Exception getRaisedException()
return eventualy raised exception during thread execution

execProcess

public void execProcess()
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        TMRuntimeException
Exec the process :parse a file or an URL content
Overrides:
execProcess in class TProcessBasic
Throws:
java.io.IOException - if an IO operation failed
org.xml.sax.SAXException - can wrap others exceptions
TMRuntimeException - any error that implementations want to raise

execProcess

public void execProcess(java.lang.String file)
                 throws TMRuntimeException
Begins the parse of a file. This method is called inside a repeat . At each loop, file is changed.
Parameters:
file - the name of the file to parse
Throws:
java.io.IOException - if an IO operation failed
org.xml.sax.SAXException - can wrap others exceptions

generatePort

public void generatePort()
Generates port for this component
Overrides:
generatePort in class TProcess_Impl

run

public final void run()
Main processing method for the TReader object
Overrides:
run in class TProcessBasic

read

public abstract void read()
                   throws java.io.IOException,
                          org.xml.sax.SAXException,
                          TMRuntimeException
This is the only method a developper has to implement in order to create a new reader. Exception raised can be encapsulated withing a TMRuntimeException
Throws:
java.io.IOException - if an IO operations failed
org.xml.sax.SAXException - can wrap others exceptions
TMRuntimeException - any error that implementations want to raise

INRIA & FluxMedia

..no bottom yet...