org.bibop.xml.xforge
Class AutomationElement

java.lang.Object
  |
  +--org.bibop.xml.xforge.AbstractElement
        |
        +--org.bibop.xml.xforge.AutomationElement
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.xml.sax.ContentHandler, Element, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.LogEnabled, ParametersListener, PrefixesMonitor, XMLConsumer, XMLProducer

public class AutomationElement
extends AbstractElement
implements ParametersListener, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.logger.LogEnabled

The real thing. given the name looks for the specified component, loads it, handles parameter passing and runs the component.

Version:
2.0
Author:
Alberto Garoffolo

Field Summary
protected  AutomatedComponent component
           
protected  org.apache.avalon.framework.component.ComponentManager componentManager
           
protected  java.lang.String componentName
           
protected  org.apache.avalon.framework.component.ComponentSelector cs
           
protected  org.apache.avalon.framework.component.ComponentException lastexception
           
protected  org.apache.avalon.framework.logger.Logger logger
           
protected  java.lang.String methodName
           
protected  java.util.Map parameters
           
 
Fields inherited from class org.bibop.xml.xforge.AbstractElement
contentHandler, lexicalHandler, parentPrefixesMonitor, po, saxEvents, xmlCompiler
 
Constructor Summary
AutomationElement(java.lang.String uri, java.lang.String localName, org.xml.sax.Attributes attrs, ProcessingOptions aPO)
          Queries the component manager for it.
 
Method Summary
private  void addAttributesToParams(org.xml.sax.Attributes attrs)
           
 void addParameter(java.lang.String name, ParameterValue value)
          Adds an attribute to the element to be built.
 void compose(org.apache.avalon.framework.component.ComponentManager cm)
          Sets the Component Manager.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
           
protected  void loadComponent()
          Load the component.
protected  void releaseComponent()
          Explicit component release to the Component Pool
 void toSax()
          Do everything.
 
Methods inherited from class org.bibop.xml.xforge.AbstractElement
characters, comment, end, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, flushSAXCache, getActivePrefixes, ignorableWhitespace, output, output, processingInstruction, setConsumer, setContentHandler, setDocumentLocator, setLexicalHandler, setParent, setParentPrefixesMonitor, skippedEntity, start, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentManager

protected org.apache.avalon.framework.component.ComponentManager componentManager

component

protected AutomatedComponent component

componentName

protected java.lang.String componentName

methodName

protected java.lang.String methodName

parameters

protected java.util.Map parameters

cs

protected org.apache.avalon.framework.component.ComponentSelector cs

lastexception

protected org.apache.avalon.framework.component.ComponentException lastexception

logger

protected org.apache.avalon.framework.logger.Logger logger
Constructor Detail

AutomationElement

public AutomationElement(java.lang.String uri,
                         java.lang.String localName,
                         org.xml.sax.Attributes attrs,
                         ProcessingOptions aPO)
                  throws IllegalElementException
Queries the component manager for it.

Parameters:
attrs - the Attributes object
Throws:
IllegalElementException - Attribute "using" empty or null
Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled

addAttributesToParams

private void addAttributesToParams(org.xml.sax.Attributes attrs)

compose

public void compose(org.apache.avalon.framework.component.ComponentManager cm)
Sets the Component Manager.

Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Parameters:
cm - the Avalon Component Manager

releaseComponent

protected void releaseComponent()
                         throws XForgeException
Explicit component release to the Component Pool

XForgeException

loadComponent

protected void loadComponent()
                      throws XForgeException
Load the component.

Throws:
XForgeException - Something wrong in Component loading

toSax

public void toSax()
           throws org.xml.sax.SAXException
Do everything.

Specified by:
toSax in interface XMLProducer
Specified by:
toSax in class AbstractElement
Throws:
org.xml.sax.SAXException - Generic Exception handling

addParameter

public void addParameter(java.lang.String name,
                         ParameterValue value)
                  throws XForgeException
Adds an attribute to the element to be built. This method is typically called by an ParameterElement object which is responsible for the parameter evaluation

Specified by:
addParameter in interface ParametersListener
Parameters:
name - The name of the parameter
value - The value of the parameter
Throws:
XForgeException - Bad or redeclared name/value


Copyright 2003 Bibop Research International. All Rights Reserved.