org.pm4j.core.pm.impl.expr
Class NameWithModifier

java.lang.Object
  extended by org.pm4j.core.pm.impl.expr.NameWithModifier
All Implemented Interfaces:
java.lang.Cloneable

public class NameWithModifier
extends java.lang.Object
implements java.lang.Cloneable

Parses a name with its modifier specification.

Examples:

   expression without modifier:         myVar
   expression for a variable:           #myVar
   expression for something optional:   (o)myVar
   expression for an optional variable: (o)#myVar
 

Author:
olaf boede

Constructor Summary
NameWithModifier()
           
 
Method Summary
 NameWithModifier clone()
           
 java.lang.String getName()
           
 boolean isOptional()
           
 boolean isVariable()
           
static NameWithModifier parseNameAndModifier(ParseCtxt ctxt)
          Parses a name with modifiers.
 void setOptional(boolean optional)
           
 void setVariable(boolean variable)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameWithModifier

public NameWithModifier()
Method Detail

isOptional

public boolean isOptional()

isVariable

public boolean isVariable()

setOptional

public void setOptional(boolean optional)

setVariable

public void setVariable(boolean variable)

getName

public java.lang.String getName()

clone

public NameWithModifier clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

parseNameAndModifier

public static NameWithModifier parseNameAndModifier(ParseCtxt ctxt)
Parses a name with modifiers.

Examples:

Parameters:
ctxt - The current parse context.
Returns:
The parsed syntax element.
Throws:
ParseException - if the string at the current parse position is not a name.