|
SMILA 1.0 API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.smila.common.definitions.AccessAny
public final class AccessAny
Some job manager related helper methods to deal with Any and their Exception handling.
Field Summary | |
---|---|
static DataFactory |
FACTORY
factory for Any. |
Method Summary | |
---|---|
static Any |
get(AnyMap any,
java.lang.String fieldName,
Any.ValueType fieldType)
get a field value from a Map and check that it has an expected type. |
static boolean |
getBoolean(AnyMap any,
java.lang.String fieldName,
boolean defaultValue)
get a boolean from a Map. |
static AnySeq |
getSeq(AnyMap any,
java.lang.String fieldName)
get a sequence from a Map. |
static java.lang.String |
getString(AnyMap any,
java.lang.String fieldName)
get a string from a Map. |
static java.lang.String |
getStringRequired(AnyMap any,
java.lang.String fieldName)
like #getString(Any, String) , but throw an exception if the field does not exists. |
static java.util.List<java.lang.String> |
getStringSeq(AnyMap any,
java.lang.String fieldName)
get list of strings from a field of the any. |
static java.lang.String |
getValidName(AnyMap any,
java.lang.String fieldName)
like #getStringRequired(Any, String) , but throw an exception if value is not a valid name accoring to
NameValidator . |
static ValueExpression |
getValueExpression(AnyMap any,
java.lang.String fieldName)
get a value expression from a Map. |
static ValueExpression |
getValueExpressionRequired(AnyMap any,
java.lang.String fieldName)
like #getValueExpression(Any, String) , but throw an exception if the field does not exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DataFactory FACTORY
Method Detail |
---|
public static Any get(AnyMap any, java.lang.String fieldName, Any.ValueType fieldType) throws InvalidDefinitionException
any
- a map any.fieldName
- key.fieldType
- expected field type
InvalidDefinitionException
- any is not a map, value does not have expected type or error accessing any.public static ValueExpression getValueExpression(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value is not a string or error accessing any.public static java.lang.String getString(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value is not a string or error accessing any.public static AnySeq getSeq(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value is not a sequence or error accessing any.public static boolean getBoolean(AnyMap any, java.lang.String fieldName, boolean defaultValue) throws InvalidDefinitionException
any
- a map any.fieldName
- key.defaultValue
- value to return if key is not set.
InvalidDefinitionException
- any is not a map, value is not a boolean or error accessing any.public static ValueExpression getValueExpressionRequired(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
#getValueExpression(Any, String)
, but throw an exception if the field does not exists.
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value does not exists or is not a string or error accessing any.public static java.lang.String getStringRequired(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
#getString(Any, String)
, but throw an exception if the field does not exists.
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value does not exists or is not a string or error accessing any.public static java.lang.String getValidName(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
#getStringRequired(Any, String)
, but throw an exception if value is not a valid name accoring to
NameValidator
.
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value does not exists or is not a string or not valid or error accessing any.public static java.util.List<java.lang.String> getStringSeq(AnyMap any, java.lang.String fieldName) throws InvalidDefinitionException
any
- a map any.fieldName
- key.
InvalidDefinitionException
- any is not a map, value is not an sequence of strings or error accessing any.
|
SMILA 1.0 API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |