junitx.ddtunit.data.processing
Class SubelementCreatorAction

java.lang.Object
  extended by junitx.ddtunit.data.processing.SubelementCreatorAction
All Implemented Interfaces:
IAction

public class SubelementCreatorAction
extends Object

This class contains object state and other information to create object from SAX event stream.

Author:
jg

Field Summary
protected  Map<String,String> attrMap
           
protected  TypedObject injectedObject
           
protected static String LF
           
protected  org.slf4j.Logger log
           
protected  IAction next
           
protected  IAction previous
           
 
Constructor Summary
SubelementCreatorAction(Map attrMap)
          Constructor used as standard constructor to instanciate actions of this type
 
Method Summary
 void add(IReferenceInfo info)
           
 TypedObject createObject()
          Create injected object to according type specification on this action.
protected  void desintegrate()
           
 String extractFieldType(String fieldName)
          Extract field type information from object sitting on the stack.
 String getAttribute(String id)
          Retrieve attribute from Action object.
 String getHint()
           
 String getId()
           
 TypedObject getInjectedObject()
           
 IAction getNext()
           
 TypedObject getObject()
           
 IAction getPrevious()
           
 String getType()
           
 String getTypeFromRoot()
          Extract object type of associated root action on action stack.
 Object getValue()
           
 boolean hasReferenceInfo()
           
 IAction inject()
          Used to append TypedObjectthat should be processed on this action.
 void insert(IAction action)
          Insert a new Record entry after this.
 void pop()
           
 IAction process()
          do process required action to transition from this state
 void processNoSuccessor()
          If no content on tag is provided just instanciate object by default constructor.
 void processSuccessor(IAction successor)
          Process successor in action stack.
 void promoteLinkChangeListener(IAction action)
           
 void registerLinkChangeListener(ILinkChangeListener listener)
           
 void registerReferenceListener(junitx.ddtunit.data.processing.IReferenceListener listener)
           
 void removeLinkChangeListener(ILinkChangeListener listener)
           
 void removeReferenceListener(junitx.ddtunit.data.processing.IReferenceListener listener)
           
 void setNext(IAction next)
           
 void setObject(TypedObject newObject)
           
 void setPrevious(IAction previous)
           
 void setType(String type)
           
 void setValue(Object obj)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected org.slf4j.Logger log

attrMap

protected Map<String,String> attrMap

injectedObject

protected TypedObject injectedObject

previous

protected IAction previous

next

protected IAction next

LF

protected static final String LF
Constructor Detail

SubelementCreatorAction

public SubelementCreatorAction(Map attrMap)
Constructor used as standard constructor to instanciate actions of this type

Parameters:
attrMap -
Method Detail

process

public IAction process()
Description copied from interface: IAction
do process required action to transition from this state


processNoSuccessor

public void processNoSuccessor()
If no content on tag is provided just instanciate object by default constructor.

Specified by:
processNoSuccessor in interface IAction

inject

public IAction inject()
Description copied from interface: IAction
Used to append TypedObjectthat should be processed on this action.


processSuccessor

public void processSuccessor(IAction successor)
Description copied from interface: IAction
Process successor in action stack.

Parameters:
successor - action in stack

registerLinkChangeListener

public void registerLinkChangeListener(ILinkChangeListener listener)
Specified by:
registerLinkChangeListener in interface IAction

removeLinkChangeListener

public void removeLinkChangeListener(ILinkChangeListener listener)
Specified by:
removeLinkChangeListener in interface IAction

pop

public void pop()

promoteLinkChangeListener

public void promoteLinkChangeListener(IAction action)
Specified by:
promoteLinkChangeListener in interface IAction

registerReferenceListener

public void registerReferenceListener(junitx.ddtunit.data.processing.IReferenceListener listener)
Specified by:
registerReferenceListener in interface IAction

add

public void add(IReferenceInfo info)

removeReferenceListener

public void removeReferenceListener(junitx.ddtunit.data.processing.IReferenceListener listener)
Specified by:
removeReferenceListener in interface IAction

desintegrate

protected void desintegrate()

getInjectedObject

public TypedObject getInjectedObject()

getHint

public String getHint()
Specified by:
getHint in interface IAction

getId

public String getId()
Specified by:
getId in interface IAction

getType

public String getType()
Specified by:
getType in interface IAction

setType

public void setType(String type)
Specified by:
setType in interface IAction

getValue

public Object getValue()
Specified by:
getValue in interface IAction

getObject

public TypedObject getObject()
Specified by:
getObject in interface IAction

setObject

public void setObject(TypedObject newObject)
Specified by:
setObject in interface IAction

setValue

public void setValue(Object obj)
Specified by:
setValue in interface IAction

getTypeFromRoot

public String getTypeFromRoot()
Extract object type of associated root action on action stack.
If no root action exists return null

Specified by:
getTypeFromRoot in interface IAction
Returns:
full qualified class name of root object type or null if no root exists.

extractFieldType

public String extractFieldType(String fieldName)
Extract field type information from object sitting on the stack.
If rootAction is a generated container action used for construction of fields or constructor call of the underlying object then skip the container action and retrieve requested type from underlying object.

Specified by:
extractFieldType in interface IAction
Parameters:
fieldName - to extract type from
Returns:
full type of field

createObject

public TypedObject createObject()
Create injected object to according type specification on this action. Just do nothing if object allready instanciated.

Specified by:
createObject in interface IAction
Returns:
RecordBase
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getNext

public IAction getNext()
Specified by:
getNext in interface IAction

setNext

public void setNext(IAction next)
Specified by:
setNext in interface IAction

getPrevious

public IAction getPrevious()
Specified by:
getPrevious in interface IAction

setPrevious

public void setPrevious(IAction previous)
Specified by:
setPrevious in interface IAction

insert

public void insert(IAction action)
Insert a new Record entry after this.

Specified by:
insert in interface IAction
Parameters:
action - to insert

toString

public String toString()
Overrides:
toString in class Object

getAttribute

public String getAttribute(String id)
Description copied from interface: IAction
Retrieve attribute from Action object.

Specified by:
getAttribute in interface IAction
Returns:
value of key

hasReferenceInfo

public boolean hasReferenceInfo()


Copyright © 2004-2011. All Rights Reserved.