org.datamixer.io
Class DMAttribute

java.lang.Object
  extended byorg.datamixer.io.DMAttribute
All Implemented Interfaces:
DatamixerEventGenerator, DatamixerListener, java.util.EventListener

public class DMAttribute
extends java.lang.Object
implements DatamixerListener, DatamixerEventGenerator


Field Summary
static int ACTION_SET_VALUE
           
static java.lang.String ACTION_SET_VALUE_NAME
           
static java.util.List ACTIONS
          action names
protected  DatamixerCollection collection_
          collection
protected  int dataType_
          datatype
protected  DMElement element_
          parent element
protected  java.text.Format format_
          formatter
protected  java.lang.String formatPattern_
          format string
protected  boolean initialized_
          true if initialized
protected  DatamixerIterator iterator_
          iterator
protected  java.lang.String name_
          attribute name
protected  java.util.List nextListeners_
          next listeners
protected  boolean repeat_
          reset limit if true
protected  Value value_
          value
protected  java.lang.String valueName_
          value name
 
Constructor Summary
DMAttribute()
           
DMAttribute(java.lang.String name)
           
DMAttribute(java.lang.String name, DatamixerIterator iter)
           
 
Method Summary
 java.lang.String actionToString(int action)
          Returns the print name of action
 void addDatamixerListener(DatamixerListener listener, int event, int action)
          Add listener.
protected  void doFireDatamixerEvent(DatamixerEvent event)
          Allows subclasses to initialize event.
protected  void error(java.lang.String message)
           
 void fireDatamixerEvent(int event)
          Calls handleDatamixerEvent on listeners.
 java.util.List getActions()
          Returns the list of available action names.
 DatamixerCollection getCollection()
           
 int getDataType()
           
 DMElement getElement()
           
 java.lang.String getFormatPattern()
           
 DatamixerIterator getIterator()
           
protected  java.util.List getListeners(int event)
          Calls handleGenerateEvent on listeners.
 java.lang.String getName()
           
 boolean getRepeat()
          Returns the repeat flag.
 boolean getUseCurrent()
           
 Value getValue()
           
 java.lang.String getValueName()
           
 void handleDatamixerEvent(DatamixerEvent e)
          Dispatches the event based on the event type and action.
protected  void initialize()
           
 void removeDatamixerListener(DatamixerListener listener, int event, int action)
          Remove listener.
 void setCollection(DatamixerCollection value)
           
 void setDataType(int value)
           
 void setElement(DMElement value)
           
 void setFormatPattern(java.lang.String value)
           
 void setIterator(DatamixerIterator value)
           
 void setName(java.lang.String value)
           
 void setRepeat(boolean value)
          Sets the repeat flag.
 void setUseCurrent(boolean value)
           
 void setValue(Value value)
          sets value as the current value, and fires a next event.
 void setValueName(java.lang.String id)
           
 int stringToAction(java.lang.String s)
          Returns the value of the action named actionName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_SET_VALUE

public static final int ACTION_SET_VALUE
See Also:
Constant Field Values

ACTION_SET_VALUE_NAME

public static final java.lang.String ACTION_SET_VALUE_NAME
See Also:
Constant Field Values

ACTIONS

public static final java.util.List ACTIONS
action names


element_

protected DMElement element_
parent element


name_

protected java.lang.String name_
attribute name


dataType_

protected int dataType_
datatype


value_

protected Value value_
value


valueName_

protected java.lang.String valueName_
value name


collection_

protected DatamixerCollection collection_
collection


iterator_

protected DatamixerIterator iterator_
iterator


repeat_

protected boolean repeat_
reset limit if true


formatPattern_

protected java.lang.String formatPattern_
format string


format_

protected java.text.Format format_
formatter


nextListeners_

protected java.util.List nextListeners_
next listeners


initialized_

protected boolean initialized_
true if initialized

Constructor Detail

DMAttribute

public DMAttribute()

DMAttribute

public DMAttribute(java.lang.String name)

DMAttribute

public DMAttribute(java.lang.String name,
                   DatamixerIterator iter)
Method Detail

handleDatamixerEvent

public void handleDatamixerEvent(DatamixerEvent e)
                          throws DatamixerException
Dispatches the event based on the event type and action. Currently event type is ignored. The action ACTION_SET_VALUE calls setValue(Value) with the value in the event.

Specified by:
handleDatamixerEvent in interface DatamixerListener
Throws:
DatamixerException

actionToString

public java.lang.String actionToString(int action)
Returns the print name of action

Specified by:
actionToString in interface DatamixerListener

stringToAction

public int stringToAction(java.lang.String s)
Returns the value of the action named actionName

Specified by:
stringToAction in interface DatamixerListener

getActions

public java.util.List getActions()
Returns the list of available action names.

Specified by:
getActions in interface DatamixerListener

addDatamixerListener

public void addDatamixerListener(DatamixerListener listener,
                                 int event,
                                 int action)
Add listener.

Specified by:
addDatamixerListener in interface DatamixerEventGenerator

removeDatamixerListener

public void removeDatamixerListener(DatamixerListener listener,
                                    int event,
                                    int action)
Remove listener. action is ignored.

Specified by:
removeDatamixerListener in interface DatamixerEventGenerator

getListeners

protected java.util.List getListeners(int event)
Calls handleGenerateEvent on listeners.


fireDatamixerEvent

public void fireDatamixerEvent(int event)
                        throws DatamixerException
Calls handleDatamixerEvent on listeners.

Specified by:
fireDatamixerEvent in interface DatamixerEventGenerator
Throws:
DatamixerException

doFireDatamixerEvent

protected void doFireDatamixerEvent(DatamixerEvent event)
                             throws DatamixerException
Allows subclasses to initialize event.

Throws:
DatamixerException

initialize

protected void initialize()

getElement

public DMElement getElement()

setElement

public void setElement(DMElement value)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String value)

getDataType

public int getDataType()

setDataType

public void setDataType(int value)

getValue

public Value getValue()
               throws DatamixerException
Throws:
DatamixerException

setValue

public void setValue(Value value)
              throws DatamixerException
sets value as the current value, and fires a next event.

Throws:
DatamixerException, - possibly thrown by the event handler.
DatamixerException

getCollection

public DatamixerCollection getCollection()

setCollection

public void setCollection(DatamixerCollection value)

getIterator

public DatamixerIterator getIterator()

setIterator

public void setIterator(DatamixerIterator value)

getRepeat

public boolean getRepeat()
Returns the repeat flag.


setRepeat

public void setRepeat(boolean value)
Sets the repeat flag.


getUseCurrent

public boolean getUseCurrent()

setUseCurrent

public void setUseCurrent(boolean value)

getFormatPattern

public java.lang.String getFormatPattern()

setFormatPattern

public void setFormatPattern(java.lang.String value)

getValueName

public java.lang.String getValueName()

setValueName

public void setValueName(java.lang.String id)

error

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


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