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).
protected  java.lang.String iFilename
          Name of the file to read
protected  org.xml.sax.InputSource inSource
          Description of the Field
protected  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).
protected  org.xml.sax.InputSource standardInput
          Description of the Field
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
finished, isThread, param, 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
 org.xml.sax.InputSource getInputSource()
          Gets the inputSource attribute of the TReader object
 java.io.InputStream getInputStream()
          Gets the inputStream attribute of the TReader object
 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
getFinished, getType, initParameters, setFinished, 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

protected 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

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

standardInput

protected org.xml.sax.InputSource standardInput
Description of the Field

inSource

protected org.xml.sax.InputSource inSource
Description of the Field
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
Returns:
The raisedException value

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:
TMRuntimeException - Description of the Exception

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

getInputSource

public org.xml.sax.InputSource getInputSource()
Gets the inputSource attribute of the TReader object
Returns:
The inputSource value

getInputStream

public java.io.InputStream getInputStream()
Gets the inputStream attribute of the TReader object
Returns:
The inputStream value

INRIA & FluxMedia

..no bottom yet...