net.sf.tomp.xtcl.command
Class StyleFilterCommand

java.lang.Object
  extended by net.sf.tomp.xtcl.command.AbstractCommand
      extended by net.sf.tomp.xtcl.command.VarCommand
          extended by net.sf.tomp.xtcl.command.AbstractParametrizedVarCommand
              extended by net.sf.tomp.xtcl.command.FilterCommand
                  extended by net.sf.tomp.xtcl.command.StyleFilterCommand
All Implemented Interfaces:
Parametrized, Command, ParametrizedCommand
Direct Known Subclasses:
STXFilterCommand, XSLTFilterCommand

public abstract class StyleFilterCommand
extends FilterCommand

Abstract ancestor for all style-based TransformerFilters

Author:
tomp

Field Summary
protected  java.lang.String styleRef
          Reference to a style (XSLT or STX)
 
Fields inherited from class net.sf.tomp.xtcl.command.FilterCommand
className, params, realParams
 
Fields inherited from class net.sf.tomp.xtcl.command.VarCommand
var
 
Constructor Summary
StyleFilterCommand()
           
 
Method Summary
 int execute(Context context)
          Sets the properties from prop. references to parameters, creates the style-based filter, initializes it, puts into Context as variable
protected abstract  org.xml.sax.XMLFilter makeFilter(Context context, java.lang.String styleRef)
          make style-based (XSLT or STX) filter
 void setStyleRef(java.lang.String s)
          set Reference to a style
 java.lang.String toString()
          Base for toString() in Joost and XSTL filters
 
Methods inherited from class net.sf.tomp.xtcl.command.FilterCommand
initFilter, setClassName, setParameter
 
Methods inherited from class net.sf.tomp.xtcl.command.AbstractParametrizedVarCommand
addParameterPropertiesReference, propertiesToParameters
 
Methods inherited from class net.sf.tomp.xtcl.command.VarCommand
setVar
 
Methods inherited from class net.sf.tomp.xtcl.command.AbstractCommand
done, initParameters, listArray, listList, listMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

styleRef

protected java.lang.String styleRef
Reference to a style (XSLT or STX)

Constructor Detail

StyleFilterCommand

public StyleFilterCommand()
Method Detail

setStyleRef

public void setStyleRef(java.lang.String s)
set Reference to a style

Parameters:
s - Reference to a style

execute

public int execute(Context context)
            throws java.lang.Exception
Sets the properties from prop. references to parameters, creates the style-based filter, initializes it, puts into Context as variable

Specified by:
execute in interface Command
Overrides:
execute in class FilterCommand
Parameters:
context - to put the filter in
Returns:
0 if OK
Throws:
java.lang.Exception - if anything fails

makeFilter

protected abstract org.xml.sax.XMLFilter makeFilter(Context context,
                                                    java.lang.String styleRef)
                                             throws javax.xml.transform.TransformerConfigurationException
make style-based (XSLT or STX) filter

Parameters:
context - the Context for getting factories
styleRef - String ref to XSLT or STX style
Returns:
the filter
Throws:
javax.xml.transform.TransformerConfigurationException - if cannot be created

toString

public java.lang.String toString()
Base for toString() in Joost and XSTL filters

Overrides:
toString in class FilterCommand
Returns:
"FILTER " + var + "=" + className + " (" + listMap(params) + ")";


Copyright © 2004-2005 Masaryk University in Brno, Faculty of Informatics, Czech Republic. All Rights Reserved.