Package de.unibamberg.minf.gtf.commands
Class BaseCommands
java.lang.Object
de.unibamberg.minf.gtf.commands.BaseCommands
- All Implemented Interfaces:
Commands
- Direct Known Subclasses:
BaseCommandDispatcher
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <T> SyntaxTreeNodeconvert(Collection<? extends T> c) <T> SyntaxTreeNodeconvert(T c) Override this method in any dispatcher that supports itself conversion of a type; throws DataTransformationException if called with unsupported type<T> Collection<T>ensureCollection(Class<T> type, Object arg) Collection<?>ensureCollection(Object arg) booleanensureCollectionSize(Object arg, int size) booleanensureCollectionSize(Object arg, int minSize, int maxSize) booleanensureCollectionSizeAtLeast(Object arg, int minSize) flattenArgs(Object[] args) getAsSimpleValue(Object arg) getAsSimpleValue(Object arg, boolean skipSubordinate) final CommandDispatcherClass<?>getEnclosedType(Object arg) Command dispatchers that have subordinate dispatchers must override this method to support cascading search for conversion supporting dispatchersbooleanisCollectionType(Object arg) booleanisNullValue(Object arg) booleansupportsConversion(Class<?> c) Override this and enable for classes that are supported by this (not subordinate) dispatcher
-
Field Details
-
SIMPLE_TYPES
-
-
Constructor Details
-
BaseCommands
public BaseCommands()
-
-
Method Details
-
getAsSimpleValue
- Specified by:
getAsSimpleValuein interfaceCommands
-
getAsSimpleValue
- Specified by:
getAsSimpleValuein interfaceCommands
-
isNullValue
- Specified by:
isNullValuein interfaceCommands
-
getEnclosedType
- Specified by:
getEnclosedTypein interfaceCommands
-
isCollectionType
- Specified by:
isCollectionTypein interfaceCommands
-
ensureCollection
- Specified by:
ensureCollectionin interfaceCommands
-
ensureCollection
- Specified by:
ensureCollectionin interfaceCommands
-
flattenArgs
- Specified by:
flattenArgsin interfaceCommands
-
ensureCollectionSize
- Specified by:
ensureCollectionSizein interfaceCommands
-
ensureCollectionSize
- Specified by:
ensureCollectionSizein interfaceCommands
-
ensureCollectionSizeAtLeast
- Specified by:
ensureCollectionSizeAtLeastin interfaceCommands
-
getSubordinateDispatchers
Command dispatchers that have subordinate dispatchers must override this method to support cascading search for conversion supporting dispatchers- Specified by:
getSubordinateDispatchersin interfaceCommands- Returns:
- Collection of subordinate dispatchers
-
supportsConversion
Override this and enable for classes that are supported by this (not subordinate) dispatcher- Specified by:
supportsConversionin interfaceCommands- Parameters:
c- possible class types- Returns:
- true if type conversion supported
-
convert
Override this method in any dispatcher that supports itself conversion of a type; throws DataTransformationException if called with unsupported type- Specified by:
convertin interfaceCommands- Parameters:
c- Object to convert- Returns:
- ConvertedSyntaxTreeNode
- Throws:
DataTransformationException
-
getConversionSupportingDispatcher
- Specified by:
getConversionSupportingDispatcherin interfaceCommands
-
convert
public final <T> SyntaxTreeNode convert(Collection<? extends T> c) throws DataTransformationException - Specified by:
convertin interfaceCommands- Throws:
DataTransformationException
-