|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ucmtwine.parameter.Parameter
public abstract class Parameter
Encapsulates a binder parameter, taking the legwork out of enforcing type and mandatory requirements.
| Field Summary | |
|---|---|
static int |
GRAMMAR_ELEMENT_UNSPECIFIED
|
protected String |
name
|
protected boolean |
required
|
protected Class<?> |
type
The actual type (may be primitive, non nullable etc) |
| Constructor Summary | |
|---|---|
protected |
Parameter()
|
protected |
Parameter(Class<?> type)
|
protected |
Parameter(String name,
Class<?> type)
Initialise a basic named binder variable. |
| Method Summary | |
|---|---|
static Parameter |
create(Class<?> type)
Create an un-named, required, parameter. |
static Parameter |
create(String name)
Shortcut to make a named String parameter. |
static Parameter |
create(String name,
Class<?> type,
boolean required)
Factory method to create the concrete variable type. |
Object |
getArgumentValue(Object object,
intradoc.server.Service service)
Get the value from another object, casting if needed. |
abstract Object |
getBinderValue(intradoc.server.Service service)
Get the value from the binder, checking for type compatibility and mandatory requirements. |
String |
getName()
Get variable name. |
String |
getStringValue(intradoc.data.DataBinder binder)
Get the string value from binder. |
Class<?> |
getType()
Returns the actual type given a type string. |
boolean |
isRequired()
|
static boolean |
parseRequiredString(String requiredString)
Based on an input string, determines if the required flag is true. |
void |
setName(String name)
Set variable name. |
void |
setRequired(boolean optional)
|
String |
toActionString()
Gets a parameter definition string for use in service actions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.ucmtwine.parameter.IParameter |
|---|
getGrammarElementType |
| Field Detail |
|---|
public static final int GRAMMAR_ELEMENT_UNSPECIFIED
protected String name
protected boolean required
protected Class<?> type
| Constructor Detail |
|---|
protected Parameter()
protected Parameter(Class<?> type)
protected Parameter(String name,
Class<?> type)
name - | Method Detail |
|---|
public static Parameter create(String name)
name -
public static Parameter create(Class<?> type)
type -
public static Parameter create(String name,
Class<?> type,
boolean required)
throws IllegalArgumentException
name - The name in the binder of the variable.
IllegalArgumentExceptionpublic String getName()
getName in interface IParameterpublic void setName(String name)
name - public boolean isRequired()
isRequired in interface IParameterpublic void setRequired(boolean optional)
public String getStringValue(intradoc.data.DataBinder binder)
public abstract Object getBinderValue(intradoc.server.Service service)
throws IllegalAccessException
getBinderValue in interface IParameterservice - The execution context.
IllegalAccessException
public Object getArgumentValue(Object object,
intradoc.server.Service service)
throws ClassCastException
getArgumentValue in interface IParameterClassCastExceptionpublic String toActionString()
toActionString in interface IParameterpublic static boolean parseRequiredString(String requiredString)
requiredString - A string containing a boolean value or "required".
public Class<?> getType()
getType in interface IParameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||