Package eu.bandm.tools.umod
Class Types
java.lang.Object
eu.bandm.tools.umod.Types
Realizes the translation from umod type expressions into Java
types, and maintains the necessary caches.
The meta-model elements which represent types have two
main fields for their Java-representation (for declaration and for
constructor calls) plus auxiliary predicates.
All these fields are valid only after
one (or multiple) visits by an instance of
Types.JavaMapper.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDelivers text to explain compound UMod types, with UMod source level type constructors, javadoc-style links to the generated classes, and additional strictness comments.static classCentral class for relating umod type definitions to Java type constructs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GeneratedAnnotationThe annotation »Deprecated«.static final GeneratedAnnotationThe annotation »Opt«.static final MetaTypeThe wildcard type without further constraints.static final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassprotected static final MetaClassprotected static final MetaClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassprotected static final MetaClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClassstatic final EnvironmentClassstatic final EnvironmentClassprotected static final MetaClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringName of a field composed of class name and field name, which will be accepted as a field name by the Java compiler.static MetaTypeReturns the class of the »Map.Entry« object for the realisation of the given umod map or relation type.static booleanReturns whether the argument is a collection (set, seq or map).static UMod.ClassDefReturns the meta-model's class definition element to which the given type is a reference, or null.static booleanhasCanonicalOrder(UMod.Type t, UMod.Forest f, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) Returns whether the argument comes with a canonical order.static booleanReturns whether the argument is a map, multimap, list or a set.static booleanReturns whether the argument is a umod basic type (umod int, float, string, char or bool).static booleanReturns whether the argument corresponds to a set of enumeration values, defined in the meta-model source by »ENUM ...«.static booleanReturns whether the argument is an imported, external class reference.static booleanReturns whether the argument is an imported external class reference.static booleanReturns whether the argument is a list or a set.static booleanReturns whether the argument is a map or a multi-map.static booleanReturns whether the argument has a top-most »OPT« operator.static booleanReturns whether the argument is a primitive scalar Java type.static booleanReturns whether the argument is a typedef reference.static UMod.TypeStrips off all top-level »OPT« operators, delivering the highest non-opt part of type expression.static inttoplevelModif(GeneratedContext context) Find the allowed modifier for top-level definitions.
-
Field Details
-
QUEST
The wildcard type without further constraints. -
annotationDeprecated
The annotation »Deprecated«. -
annotationOpt
The annotation »Opt«. -
WRAPPEDCLASS_void
-
WRAPPEDCLASS_Object
-
WRAPPEDCLASS_Class
-
WRAPPEDCLASS_int
-
WRAPPEDCLASS_Integer
-
WRAPPEDCLASS_double
-
WRAPPEDCLASS_Double
-
WRAPPEDCLASS_float
-
WRAPPEDCLASS_Float
-
WRAPPEDCLASS_char
-
WRAPPEDCLASS_Character
-
WRAPPEDCLASS_String
-
WRAPPEDCLASS_boolean
-
WRAPPEDCLASS_Boolean
-
WRAPPEDCLASS_CollectionFactory
-
WRAPPEDCLASS_Optional
-
WRAPPEDCLASS_List
-
WRAPPEDCLASS_LinkedList
-
WRAPPEDCLASS_ArrayList
-
WRAPPEDCLASS_Format
-
WRAPPEDCLASS_Pattern
-
WRAPPEDCLASS_TotalTransform
-
WRAPPEDCLASS_ReflectionPatterns
-
WRAPPEDCLASS_Comparable
-
WRAPPEDCLASS_EnumSet
-
WRAPPEDCLASS_EnumMap
-
WRAPPEDCLASS_CheckedEnumMap
-
WRAPPEDCLASS_CheckedList
-
WRAPPEDCLASS_Set
-
WRAPPEDCLASS_HashSet
-
WRAPPEDCLASS_CheckedSet
-
WRAPPEDCLASS_Map
-
WRAPPEDCLASS_MapEntry
-
WRAPPEDCLASS_Collection
-
WRAPPEDCLASS_HashMap
-
WRAPPEDCLASS_CheckedMap_R
-
WRAPPEDCLASS_CheckedMap_D
-
WRAPPEDCLASS_CheckedMap_RD
-
WRAPPEDCLASS_Multimap
-
WRAPPEDCLASS_HashMultimap
-
WRAPPEDCLASS_Multimaps
-
WRAPPEDCLASS_Pair
-
WRAPPEDCLASS_Pair_checkedLeft
-
WRAPPEDCLASS_Pair_checkedRight
-
WRAPPEDCLASS_UncheckedPair
-
WRAPPEDCLASS_CheckedPair_L
-
WRAPPEDCLASS_CheckedPair_R
-
WRAPPEDCLASS_CheckedPair_LR
-
WRAPPEDCLASS_CoPair
-
WRAPPEDCLASS_CoPair_checkedLeft
-
WRAPPEDCLASS_CoPair_checkedRight
-
WRAPPEDCLASS_UncheckedCoPair
-
WRAPPEDCLASS_CheckedCoPair_L
-
WRAPPEDCLASS_CheckedCoPair_R
-
WRAPPEDCLASS_CheckedCoPair_LR
-
WRAPPEDCLASS_ops_Function
-
WRAPPEDCLASS_ops_Consumer
-
WRAPPEDCLASS_Objects
-
WRAPPEDCLASS_OptimizingVisitor
-
WRAPPEDCLASS_Rewriter
-
WRAPPEDCLASS_IllegalStateException
-
-
Constructor Details
-
Types
public Types()
-
-
Method Details
-
compilableFieldName
Name of a field composed of class name and field name, which will be accepted as a field name by the Java compiler.- Parameters:
fd- the field- Returns:
- a composed and compilable name
-
toplevelModif
Find the allowed modifier for top-level definitions. If context is not a GeneratedClass, then it is a GeneratedPackage and »static« is not allowed.- Parameters:
context- whereto the Java sources are generated- Returns:
- the default modifier for top-level definitions
-
nonOpt
Strips off all top-level »OPT« operators, delivering the highest non-opt part of type expression.- Parameters:
t- the type- Returns:
- the type without any top-most »OPT« operators.
-
isOpt
Returns whether the argument has a top-most »OPT« operator.- Parameters:
t- the type- Returns:
- whether the argument has a top-most »OPT« operator.
-
isPrimitive
Returns whether the argument is a primitive scalar Java type. (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- whether the argument is a primitive scalar Java type.
-
isBasic
Returns whether the argument is a umod basic type (umod int, float, string, char or bool).- Parameters:
t- the type- Returns:
- whether the argument is a umo basic type.
-
isExternalReferenceType
Returns whether the argument is an imported external class reference. (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- whether the argument is an imported external class reference.
-
isExternal
Returns whether the argument is an imported, external class reference. (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- whether the argument is an imported, external class reference.
-
isTypedefReferenceType
Returns whether the argument is a typedef reference. (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- whether the argument is a typedef reference.
-
isEnumSetType
Returns whether the argument corresponds to a set of enumeration values, defined in the meta-model source by »ENUM ...«. (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- whether the argument corresponds to a set of enumeration values.
-
getUmodClassDef
Returns the meta-model's class definition element to which the given type is a reference, or null. (Valid after a visit of a JavaMapper.)- Parameters:
f- the containing umod meta-modelt- the type- Returns:
- the class definitions element to which t refers, if any.
-
defaultIsEmptyCollection
Returns whether the argument is a collection (set, seq or map). (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- whether the argument is a collection (set, seq or map).
-
hasCanonicalOrder
public static boolean hasCanonicalOrder(UMod.Type t, UMod.Forest f, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) Returns whether the argument comes with a canonical order. For basic types a canonical order is always defined; For basic types a canonical order is always defined; for internal definitions this depends on generated code; for external types the environment ust be asked.- Parameters:
t- the typef- the containing umod meta-model- Returns:
- whether the argument comes with a canonical order.
-
isMapoid
Returns whether the argument is a map or a multi-map. AnOptoperator is not considered.- Parameters:
t- the type- Returns:
- whether the argument is a map or a multi-map.
-
isListoid
Returns whether the argument is a list or a set. AnOptoperator is not considered.- Parameters:
t- the type- Returns:
- whether the argument is a list or a set.
-
hasVariableLength
Returns whether the argument is a map, multimap, list or a set.- Parameters:
t- the type- Returns:
- whether the argument is a map, multimap, list or a set.
-
declaredMapEntryType
Returns the class of the »Map.Entry« object for the realisation of the given umod map or relation type. (Valid after a visit of a JavaMapper.)- Parameters:
t- the type- Returns:
- the class of the »Map.Entry« object.
-