tomp.ext
Class Application

java.lang.Object
  |
  +--tomp.ext.Application
Direct Known Subclasses:
ConsoleApplication, ServletApplication

public abstract class Application
extends java.lang.Object

This abstract Application class a basic class for all EXT applications.

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

Field Summary
static short LOGFILE
           
static short NONE
           
static short STDERR
           
 
Constructor Summary
Application()
          Default constructor with no parameters, initializing the Application with Crimson XMLReaderImpl SAX2 parser for source files Crimson XMLReaderImpl SAX2 parser for style files default MySQL database driver class default Windows-1250 encoding and default EXT prefix ("ext") and default EXT URI ("http://ext.cz") logging to System.err
Application(java.lang.String i, java.lang.String sourceParser, java.lang.String styleParser, java.lang.String extNsURI, java.lang.String extNsPrefix, java.lang.String defaultMySQLDriver, java.lang.String configFile)
          General Application constructor defaulting the TREE_MODEL to TINY_TREE allocating the app-level XML names under the ext namespace registering the tomp.ext.cmd.GenericAction.class as the default Action.class
 
Method Summary
 int allocateEXTName(java.lang.String localName)
          Allocates the localName under the EXT namespace
 int allocateName(java.lang.String nsPrefix, short nsCode, java.lang.String localName)
          Allocates the localName under the nsCode (short), nsPrefix namespace
 int allocateName(java.lang.String nsPrefix, java.lang.String nsURI, java.lang.String localName)
          Allocates the localName under the nsURI, nsPrefix namespace
 int allocateNCName(java.lang.String localName)
          Allocates the localName as unqualified (no-colon) name (i.e.under default Namespace)
 void endInputDocument(net.sf.saxon.om.Builder b)
           
 java.lang.Class getActionClass(java.lang.Class c)
          Retrieve an registered action class
 short getCodeForURI(java.lang.String uri)
           
 java.lang.String getDefaultMySQLDriver()
           
 java.lang.String getDefaultOutputEncoding()
           
 java.lang.String getDefaultOutputMethod()
           
 javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()
           
 net.sf.saxon.tree.AttributeCollection getEmptyAC()
          Creates the empty SAX2 AttributeCollection (gives the same instance at each call)
 net.sf.saxon.om.NamePool getNamePool()
           
 javax.xml.transform.TransformerFactory getTransformerFactory()
           
 java.lang.String id()
          Gives the Application id
protected  Action makeAction(java.lang.Class id, Action previous)
          Make an Action (according to registered classes).
 net.sf.saxon.om.Builder newBuilder()
          Creates a new SAXON TinyBuilder
 org.w3c.dom.Document newDocument()
          Builds a new org.w3c.dom.Document with the default docBuilder
 net.sf.saxon.tree.AttributeCollection newEmptyAC()
          Creates a new empty SAX2 AttributeCollection
 int[] newNSArrayForName(int name)
           
 javax.xml.transform.Templates newTemplates(javax.xml.transform.Source src)
          Builds a new javax.xml.transform.Templates from javax.xml.transform.Source src with the default transformerFactory
 javax.xml.transform.sax.TemplatesHandler newTemplatesHandler()
           
 void registerActionClass(java.lang.Class c1, java.lang.Class c2)
          Register an action class
 void startInputDocument(net.sf.saxon.om.Builder b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final short NONE
See Also:
Constant Field Values

STDERR

public static final short STDERR
See Also:
Constant Field Values

LOGFILE

public static final short LOGFILE
See Also:
Constant Field Values
Constructor Detail

Application

public Application()
Default constructor with no parameters, initializing the Application with


Application

public Application(java.lang.String i,
                   java.lang.String sourceParser,
                   java.lang.String styleParser,
                   java.lang.String extNsURI,
                   java.lang.String extNsPrefix,
                   java.lang.String defaultMySQLDriver,
                   java.lang.String configFile)
General Application constructor

Method Detail

allocateEXTName

public int allocateEXTName(java.lang.String localName)
Allocates the localName under the EXT namespace


allocateName

public int allocateName(java.lang.String nsPrefix,
                        short nsCode,
                        java.lang.String localName)
Allocates the localName under the nsCode (short), nsPrefix namespace


allocateName

public int allocateName(java.lang.String nsPrefix,
                        java.lang.String nsURI,
                        java.lang.String localName)
Allocates the localName under the nsURI, nsPrefix namespace


allocateNCName

public int allocateNCName(java.lang.String localName)
Allocates the localName as unqualified (no-colon) name (i.e.under default Namespace)


newDocument

public org.w3c.dom.Document newDocument()
Builds a new org.w3c.dom.Document with the default docBuilder


newTemplates

public javax.xml.transform.Templates newTemplates(javax.xml.transform.Source src)
                                           throws javax.xml.transform.TransformerConfigurationException
Builds a new javax.xml.transform.Templates from javax.xml.transform.Source src with the default transformerFactory

javax.xml.transform.TransformerConfigurationException

newTemplatesHandler

public javax.xml.transform.sax.TemplatesHandler newTemplatesHandler()
                                                             throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException

newEmptyAC

public net.sf.saxon.tree.AttributeCollection newEmptyAC()
Creates a new empty SAX2 AttributeCollection


getEmptyAC

public net.sf.saxon.tree.AttributeCollection getEmptyAC()
Creates the empty SAX2 AttributeCollection (gives the same instance at each call)


newBuilder

public net.sf.saxon.om.Builder newBuilder()
Creates a new SAXON TinyBuilder


id

public java.lang.String id()
Gives the Application id


newNSArrayForName

public int[] newNSArrayForName(int name)

getCodeForURI

public short getCodeForURI(java.lang.String uri)

startInputDocument

public void startInputDocument(net.sf.saxon.om.Builder b)
                        throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException

endInputDocument

public void endInputDocument(net.sf.saxon.om.Builder b)
                      throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException

makeAction

protected Action makeAction(java.lang.Class id,
                            Action previous)
                     throws EXTException
Make an Action (according to registered classes). If the required class is not registered, throws an exception

EXTException

registerActionClass

public void registerActionClass(java.lang.Class c1,
                                java.lang.Class c2)
Register an action class

Parameters:
c1 - key class
c2 - value class (will be returned on getActionClass(c1))

getActionClass

public java.lang.Class getActionClass(java.lang.Class c)
                               throws java.lang.ClassNotFoundException
Retrieve an registered action class

Parameters:
c - key class value class will be returned on getActionClass(c)
java.lang.ClassNotFoundException

getDefaultOutputEncoding

public java.lang.String getDefaultOutputEncoding()

getDefaultOutputMethod

public java.lang.String getDefaultOutputMethod()

getDefaultMySQLDriver

public java.lang.String getDefaultMySQLDriver()

getNamePool

public net.sf.saxon.om.NamePool getNamePool()

getTransformerFactory

public javax.xml.transform.TransformerFactory getTransformerFactory()

getDocumentBuilderFactory

public javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()