org.datamixer.config
Class ElementBase

java.lang.Object
  extended byorg.datamixer.config.ElementBase
All Implemented Interfaces:
DatamixerConfig
Direct Known Subclasses:
AttributeConfig, CollectionConfig, ConstantsIteratorConfig, ElementConfig, FileConfig, FormatterConfig, GeneratorConfig, ListenerConfig, NextValueConfig, PageConfig, ReaderConfig, TextConfig, ValueListConfig, WriterConfig

public class ElementBase
extends java.lang.Object
implements DatamixerConfig


Constructor Summary
ElementBase()
           
 
Method Summary
 boolean addElement(DatamixerConfig element)
          Add element to self as a nested element.
protected  void addField(java.lang.reflect.Field field)
          Get a field.
 void addListener(DatamixerConfig listener)
          Add listener to self as a nested listener.
protected  void doGetSupportedAttrs(java.util.List names)
          A list of names of supported attributes.
protected  void doInitialize()
           
protected  void error(java.lang.Exception e)
           
protected  void error(java.lang.String errmsg)
           
protected  void error(java.lang.String errmsg, java.lang.Exception e)
           
 DatamixerContext findContext(int scope)
          Get the context at scope.
 java.lang.Object findInContext(java.lang.String name)
          Finds an object by name in the nearest enclosing scope.
 java.lang.Object findInContext(java.lang.String name, int scope)
          Finds an object by name in scope.
protected  DatamixerContext findNearestContext()
          Get the context at the nearest enclosing scope.
 java.lang.Object getAttribute(java.lang.String name)
          Get the value of the attribute named name.
 DatamixerContext getContext()
          Get the context.
 DatamixerConfig getElement(int index)
          Returns the element at index.
 java.util.List getElements()
          Get the list of nested elements.
protected  java.lang.reflect.Field getField(java.lang.String name)
          Get the value of the attribute named name.
protected  java.util.Map getFields()
          Get the fields map.
protected  java.lang.String getId()
           
 java.lang.Object getImpl()
          Return the implementation.
 int getLineNumber()
           
 java.util.List getListeners()
          Get the list of listeners.
 java.lang.String getNamespace()
          Get the namespace.
 DatamixerConfig getParent()
          Gets the parent.
protected  DatamixerConfig getParentByTag(java.lang.String tag)
          Returns this, or the first parent whose tag is tag.
 java.lang.String getQName()
          Get the qualified name.
 java.lang.Integer getScope()
           
 java.util.List getSupportedAttrs()
          Returns a list of names of supported attributes.
 java.lang.String getSystemId()
           
 java.lang.String getTag()
          Get the tag.
 java.lang.String getText()
          Get the text;
 void initialize()
          initialize
protected  void initializeElements()
           
 boolean setAttribute(java.lang.String name, java.lang.Object value)
          Set value into the attribute named name.
 void setId(java.lang.String value)
           
 void setImpl(java.lang.Object impl)
          Set the implementation.
 void setInContext(java.lang.String name, java.lang.Object value)
          Does nothing if name is null.
 void setInContext(java.lang.String name, java.lang.Object value, java.lang.Integer scope)
          Does nothing if name is null.
 void setLineNumber(int value)
           
protected  void setListenerImpls(DatamixerEventGenerator parentGenerator)
          Add listeners to parentGenerator, or generator attribute if set.
 void setNamespace(java.lang.String namespace)
          Set the namespace.
 void setParent(DatamixerConfig parent)
          Sets the parent.
 void setScope(int value)
           
 void setScope(java.lang.Integer value)
           
 void setScope(java.lang.String tag)
           
 void setSystemId(java.lang.String value)
           
 void setTag(java.lang.String tag)
          Set the tag.
 void setText(java.lang.String text)
          Set the text;
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementBase

public ElementBase()
Method Detail

initialize

public void initialize()
                throws DatamixerException
Description copied from interface: DatamixerConfig
initialize

Specified by:
initialize in interface DatamixerConfig
Throws:
DatamixerException

doInitialize

protected void doInitialize()
                     throws DatamixerException
Throws:
DatamixerException

initializeElements

protected void initializeElements()
                           throws DatamixerException
Throws:
DatamixerException

getImpl

public java.lang.Object getImpl()
Return the implementation.

Specified by:
getImpl in interface DatamixerConfig

setImpl

public void setImpl(java.lang.Object impl)
Set the implementation.

Specified by:
setImpl in interface DatamixerConfig

getContext

public DatamixerContext getContext()
Get the context. Implemented by PageConfig and ApplicationConfig.

Specified by:
getContext in interface DatamixerConfig

findContext

public DatamixerContext findContext(int scope)
Get the context at scope. Scope is DatamixerContext.SCOPE_APPLICATION or DatamixerContext.SCOPE_PAGE.

Specified by:
findContext in interface DatamixerConfig

findInContext

public java.lang.Object findInContext(java.lang.String name)
Finds an object by name in the nearest enclosing scope.

Specified by:
findInContext in interface DatamixerConfig

findInContext

public java.lang.Object findInContext(java.lang.String name,
                                      int scope)
Finds an object by name in scope.

Specified by:
findInContext in interface DatamixerConfig

setInContext

public void setInContext(java.lang.String name,
                         java.lang.Object value)
Does nothing if name is null. Otherwise sets object by name into the nearest enclosing scope.

Specified by:
setInContext in interface DatamixerConfig

setInContext

public void setInContext(java.lang.String name,
                         java.lang.Object value,
                         java.lang.Integer scope)
Does nothing if name is null. Otherwise sets object by name into scope, or into the nearest enclosing scope, if scope is null.

Specified by:
setInContext in interface DatamixerConfig

findNearestContext

protected DatamixerContext findNearestContext()
Get the context at the nearest enclosing scope.


getQName

public java.lang.String getQName()
Get the qualified name.

Specified by:
getQName in interface DatamixerConfig

getNamespace

public java.lang.String getNamespace()
Get the namespace.

Specified by:
getNamespace in interface DatamixerConfig

setNamespace

public void setNamespace(java.lang.String namespace)
Set the namespace.

Specified by:
setNamespace in interface DatamixerConfig

getTag

public java.lang.String getTag()
Get the tag.

Specified by:
getTag in interface DatamixerConfig

setTag

public void setTag(java.lang.String tag)
Set the tag.

Specified by:
setTag in interface DatamixerConfig

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Get the value of the attribute named name.

Specified by:
getAttribute in interface DatamixerConfig

getField

protected java.lang.reflect.Field getField(java.lang.String name)
Get the value of the attribute named name.


addField

protected void addField(java.lang.reflect.Field field)
Get a field.


getFields

protected java.util.Map getFields()
Get the fields map.


setAttribute

public boolean setAttribute(java.lang.String name,
                            java.lang.Object value)
Set value into the attribute named name. Returns true if element was set, false otherwise.

Specified by:
setAttribute in interface DatamixerConfig

getSupportedAttrs

public java.util.List getSupportedAttrs()
Returns a list of names of supported attributes.

Specified by:
getSupportedAttrs in interface DatamixerConfig

doGetSupportedAttrs

protected void doGetSupportedAttrs(java.util.List names)
A list of names of supported attributes.


getParent

public DatamixerConfig getParent()
Gets the parent.

Specified by:
getParent in interface DatamixerConfig

setParent

public void setParent(DatamixerConfig parent)
Sets the parent.

Specified by:
setParent in interface DatamixerConfig

getElements

public java.util.List getElements()
Get the list of nested elements.

Specified by:
getElements in interface DatamixerConfig

getElement

public DatamixerConfig getElement(int index)
Returns the element at index.


addElement

public boolean addElement(DatamixerConfig element)
Add element to self as a nested element. Returns true if element was set, false otherwise.

Specified by:
addElement in interface DatamixerConfig

getListeners

public java.util.List getListeners()
Get the list of listeners.


addListener

public void addListener(DatamixerConfig listener)
Add listener to self as a nested listener. Returns true if listener was set, false otherwise.


setListenerImpls

protected void setListenerImpls(DatamixerEventGenerator parentGenerator)
                         throws DatamixerException
Add listeners to parentGenerator, or generator attribute if set.

Throws:
DatamixerException

getText

public java.lang.String getText()
Get the text;


setText

public void setText(java.lang.String text)
Set the text;


toString

public java.lang.String toString()

getId

protected java.lang.String getId()

setId

public void setId(java.lang.String value)

getScope

public java.lang.Integer getScope()

setScope

public void setScope(java.lang.Integer value)

setScope

public void setScope(int value)

setScope

public void setScope(java.lang.String tag)

getParentByTag

protected DatamixerConfig getParentByTag(java.lang.String tag)
Returns this, or the first parent whose tag is tag.


getSystemId

public java.lang.String getSystemId()
Specified by:
getSystemId in interface DatamixerConfig

setSystemId

public void setSystemId(java.lang.String value)
Specified by:
setSystemId in interface DatamixerConfig

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface DatamixerConfig

setLineNumber

public void setLineNumber(int value)
Specified by:
setLineNumber in interface DatamixerConfig

error

protected void error(java.lang.String errmsg)
              throws DatamixerException
Throws:
DatamixerException

error

protected void error(java.lang.Exception e)
              throws DatamixerException
Throws:
DatamixerException

error

protected void error(java.lang.String errmsg,
                     java.lang.Exception e)
              throws DatamixerException
Throws:
DatamixerException


Copyright © 2004-2006 datamixer.org. All Rights Reserved.