tomp.ext
Class Base

java.lang.Object
  |
  +--tomp.ext.Base
Direct Known Subclasses:
FileSet, FileSource, JDBCConnection, SQLUpdate, Style, Transformation, TreeSource, URLSource

public abstract class Base
extends java.lang.Object

This Base class a basic class for all EXT classes that do the "real" work:

Version:
0.9
Author:
Tomas Pitner (tomp@fi.muni.cz)

Field Summary
protected  Action action
           
protected  Application application
           
protected  int status
           
static java.lang.String[] STATUS
          String representation of the object status: whether it is just created (not processed), processed (ready or aborted), processed (valid or invalid)
static int STATUS_ABORTED
           
static int STATUS_IN_PROCESSING
           
static int STATUS_NOT_PROCESSED
          Codes of the object status: whether it is just created (not processed), processed (ready or aborted), processed (valid or invalid)
static int STATUS_READY
           
static int STATUS_READY_INVALID
           
static int STATUS_READY_VALID
           
protected  Validator validator
           
 
Constructor Summary
Base(Action action, java.lang.String id, Validator validator)
          The one and only constructor for Base objects
 
Method Summary
 void abortProcessing()
          Called when processing is aborted (not OK).
 void commitProcessing()
          Called when processing is committed (i.e. not aborted, OK).
 javax.xml.transform.Source getAsRawSource()
          The getAsRawSource() is actually abstract in this abstract class.
 javax.xml.transform.Source getAsSource()
          The getAsSource() provides a javax.xml.transform.Source object containing the content of this Base object.
 java.lang.String id()
          Returns the identification.
 boolean isReady()
          is this Base object ready?
 boolean isValid()
          is this Base object ready and valid?
 void startProcessing()
          Called when processing starts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS

public static final java.lang.String[] STATUS

String representation of the object status:

whether it is just created (not processed), processed (ready or aborted), processed (valid or invalid)


STATUS_NOT_PROCESSED

public static final int STATUS_NOT_PROCESSED

Codes of the object status:

whether it is just created (not processed), processed (ready or aborted), processed (valid or invalid)

See Also:
Constant Field Values

STATUS_IN_PROCESSING

public static final int STATUS_IN_PROCESSING
See Also:
Constant Field Values

STATUS_ABORTED

public static final int STATUS_ABORTED
See Also:
Constant Field Values

STATUS_READY

public static final int STATUS_READY
See Also:
Constant Field Values

STATUS_READY_INVALID

public static final int STATUS_READY_INVALID
See Also:
Constant Field Values

STATUS_READY_VALID

public static final int STATUS_READY_VALID
See Also:
Constant Field Values

application

protected Application application

action

protected Action action

status

protected int status

validator

protected Validator validator
Constructor Detail

Base

public Base(Action action,
            java.lang.String id,
            Validator validator)
The one and only constructor for Base objects

Parameters:
action - The Action object where this Base will be stored. The action provides the Base objects some services, like
id - an identifier of this object, must be unique in the whole application. (actually not in WHOLE application, only is the actual scope on any action). The Base object will be stored to the Action under this "id".
validator - must specify a validator object for validating may be null, in such case no validation will be performed when getAsSource() is called.
Method Detail

getAsSource

public javax.xml.transform.Source getAsSource()
                                       throws EXTException

The getAsSource() provides a javax.xml.transform.Source object containing the content of this Base object. It performs validation of the content if the validator is presented (not null).

Typically, it is not overloaded, rather, the getAsRawSource() is overloaded in any subclass of Base.

EXTException

getAsRawSource

public javax.xml.transform.Source getAsRawSource()
                                          throws EXTException

The getAsRawSource() is actually abstract in this abstract class. It will return a source before validation.

Will be overloaded in any subclass.

EXTException

id

public java.lang.String id()

Returns the identification.


startProcessing

public void startProcessing()
Called when processing starts.


commitProcessing

public void commitProcessing()
Called when processing is committed (i.e. not aborted, OK).


abortProcessing

public void abortProcessing()
Called when processing is aborted (not OK).


isReady

public boolean isReady()
is this Base object ready? i.e. processed and committed.


isValid

public boolean isValid()
                throws EXTException
is this Base object ready and valid? i.e. processed, committed, successfully validated.

EXTException