Package com.sun.corba.ee.spi.orb
Class OperationFactory
- java.lang.Object
-
- com.sun.corba.ee.spi.orb.OperationFactory
-
public abstract class OperationFactory extends java.lang.ObjectThis is a static factory class for commonly used operations for property parsing. The following operations are supported:- maskErrorAction( Operation op ) executes op and returns the result. If op throws an exception, the result is null.
- indexAction( int arg ) returns the [arg] element of value, which must be an Object[]
- identityAction() return the value
- booleanAction() return a Boolean representing true or false values of the String value
- integerAction() returns an Integer for the String value, which must be a decimal integer
- stringAction() returns the String value
- classAction() returns a class for the String value, as loaded by the ORB classloader
- setFlagAction() always return Boolean.TRUE
- URLAction() returns a java.net.URL for the String value, which must be a valid URL
- integerRangeAction( int min, int max ) returns an Integer for the String value, which must be a decimal integer in the range min to max inclusive
- listAction( String sep, Operation ) tokenizes the String value with sep as separator, then applies the Operation to each token, and returns an array of the result
- sequenceAction( String, Operation[] ) tokenizes the String value with sep as separator, then applies each Operation in the Operation array to successive tokens, and returns an array of the results
- compose( Operation op1, Operation op2 ) is the operation that applies op2 to the result of applying op1 to the value
- mapAction( Operation ) applies the Operation to each element of an array of objects, and returns an array of the results
- mapSequenceAction( Operation[] ) applies the corresponding element of the Operation array to an element of the Object[] value, and returns an array of the results
- convertIntegerToShort coerces an Integer into a Short.
This class also provides a simple ArgumentParser that can be used to parse simple String[] data using the Operations framework.
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description private static OperationbooleanActionImplprivate static OperationconvertIntegerToShortImplprivate static OperationidentityActionImplprivate static OperationintegerActionImplprivate static OperationsetFlagActionImplprivate static OperationstringActionImplprivate static OperationsuffixActionImplprivate static OperationURLActionImplprivate static OperationvalueActionImplprivate static ORBUtilSystemExceptionwrapper
-
Constructor Summary
Constructors Modifier Constructor Description privateOperationFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OperationbooleanAction()static OperationclassAction(org.glassfish.pfl.basic.func.UnaryFunction<java.lang.String,java.lang.Class<?>> resolver)static Operationcompose(Operation op1, Operation op2)static OperationconvertIntegerToShort()private static java.lang.Object[]getObjectArray(java.lang.Object obj)private static java.lang.StringgetString(java.lang.Object obj)private static org.glassfish.pfl.basic.contain.Pair<java.lang.String,java.lang.String>getStringPair(java.lang.Object obj)static OperationidentityAction()static OperationindexAction(int index)static OperationintegerAction()static OperationintegerRangeAction(int min, int max)static OperationlistAction(java.lang.String sep, Operation act)static OperationmapAction(Operation op)static OperationmapSequenceAction(Operation[] op)static OperationmaskErrorAction(Operation op)static OperationsequenceAction(java.lang.String sep, Operation[] actions)static OperationsetFlagAction()static OperationstringAction()static OperationsuffixAction()static OperationURLAction()static OperationvalueAction()
-
-
-
Field Detail
-
wrapper
private static final ORBUtilSystemException wrapper
-
suffixActionImpl
private static Operation suffixActionImpl
-
valueActionImpl
private static Operation valueActionImpl
-
identityActionImpl
private static Operation identityActionImpl
-
booleanActionImpl
private static Operation booleanActionImpl
-
integerActionImpl
private static Operation integerActionImpl
-
stringActionImpl
private static Operation stringActionImpl
-
setFlagActionImpl
private static Operation setFlagActionImpl
-
URLActionImpl
private static Operation URLActionImpl
-
convertIntegerToShortImpl
private static Operation convertIntegerToShortImpl
-
-
Method Detail
-
getString
private static java.lang.String getString(java.lang.Object obj)
-
getObjectArray
private static java.lang.Object[] getObjectArray(java.lang.Object obj)
-
getStringPair
private static org.glassfish.pfl.basic.contain.Pair<java.lang.String,java.lang.String> getStringPair(java.lang.Object obj)
-
indexAction
public static Operation indexAction(int index)
-
identityAction
public static Operation identityAction()
-
suffixAction
public static Operation suffixAction()
-
valueAction
public static Operation valueAction()
-
booleanAction
public static Operation booleanAction()
-
integerAction
public static Operation integerAction()
-
stringAction
public static Operation stringAction()
-
classAction
public static Operation classAction(org.glassfish.pfl.basic.func.UnaryFunction<java.lang.String,java.lang.Class<?>> resolver)
-
setFlagAction
public static Operation setFlagAction()
-
URLAction
public static Operation URLAction()
-
integerRangeAction
public static Operation integerRangeAction(int min, int max)
-
convertIntegerToShort
public static Operation convertIntegerToShort()
-
-