step.typedef
Class FieldModifier

java.lang.Object
  |
  +--step.typedef.FieldModifier
All Implemented Interfaces:
Cloneable, StepDef

public class FieldModifier
extends Object
implements StepDef, Cloneable

Abstraction of a STEP field modifier.

NOTE: Field modifiers are only meaningful before a type definition has been resolved.

See Also:
FieldDef, TypeDef.resolve()

Constructor Summary
FieldModifier(String target, boolean clean)
          Create a new field modifier.
 
Method Summary
 FieldModifier addAttribute(Attribute attribute)
          Add an attribute to this modifier.
 Object clone()
          Get a copy of this modifier.
 List getAttributes()
          Get the attributes held by this modifier.
 String getTarget()
          Get the name of the target field for this modifier.
 boolean isClean()
          Does this modifier cause previous (including inherited) attributes to be discarded?
 String toStepDL()
          Get this modifier as STEP-DL text.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldModifier

public FieldModifier(String target,
                     boolean clean)
Create a new field modifier.

Parameters:
target - the field to apply this modifier to. NOTE: The target may be a qualified name.
clean - override (discard) previous attributes?
Method Detail

getTarget

public String getTarget()
Get the name of the target field for this modifier.

NOTE: The target may be a qualified name.


isClean

public boolean isClean()
Does this modifier cause previous (including inherited) attributes to be discarded?


getAttributes

public List getAttributes()
Get the attributes held by this modifier.


addAttribute

public FieldModifier addAttribute(Attribute attribute)
Add an attribute to this modifier.

The current modifier is returned by this method to allow chaining of multiple calls or immediate addition to a newly created instance. For example,

FieldModifier m = new FieldModifier(..).addAttribute(..)...

Returns:
this object.

clone

public Object clone()
Get a copy of this modifier.

Overrides:
clone in class Object

toStepDL

public String toStepDL()
Get this modifier as STEP-DL text.

Specified by:
toStepDL in interface StepDef