public class ClassUtility extends Object
ATTRIBUTE_PREFIX + attribute name, value = type (for primitives or
String)ATTRIBUTE_PREFIX + attribute name
NAME_ARRAY_PROPERTY_TYPE (property for primitives or String,
reference element for reference types)NAME_ARRAY_PROPERTY_DIMENSIONS numeric number of nested array dimensionsATTRIBUTE_PREFIX + attribute name,
value = ref-to collection (for reference types)Skip will not be listed. So far, arrays over reference types are represented as
strings rather than references to the component type.
The implemented format is initial and will change over time (array of ref type unclear, generics).| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_PREFIX |
static String |
NAME_ARRAY_PROPERTY_DIMENSIONS |
static String |
NAME_ARRAY_PROPERTY_TYPE |
private static Map<Class<?>,String> |
NAME_MAPPING |
static String |
NAME_TYPE_SUBMODEL |
| Constructor and Description |
|---|
ClassUtility() |
| Modifier and Type | Method and Description |
|---|---|
static de.iip_ecosphere.platform.support.aas.Reference |
addType(de.iip_ecosphere.platform.support.aas.Aas.AasBuilder aasBuilder,
Class<?> type)
Adds a type to an AAS as sub-model.
|
private static de.iip_ecosphere.platform.support.aas.Reference |
addType(de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder builder,
Class<?> type)
Adds a type to a sub-model.
|
static de.iip_ecosphere.platform.support.aas.SubmodelElement |
addTypeSubModelElement(de.iip_ecosphere.platform.support.aas.SubmodelElementContainerBuilder subModelBuilder,
String idShort,
Class<?> type)
Adds a type-representing sub-model element.
|
static String |
getId(String prefix,
Object object)
Turns the object into a unique id with given (optional) prefix.
|
static String |
getName(Class<?> type)
Returns the name of the associated model element.
|
private static void |
registerBySimpleName(Class<?> type)
Registers a
type by its simple name. |
private static void |
registerBySimpleName(Class<?> type,
Class<?> nameType)
Registers a
type by the simple name of nameType, e.g., to map wrappers to their primitive types. |
public static final String NAME_TYPE_SUBMODEL
public static final String ATTRIBUTE_PREFIX
public static final String NAME_ARRAY_PROPERTY_TYPE
public static final String NAME_ARRAY_PROPERTY_DIMENSIONS
private static void registerBySimpleName(Class<?> type)
type by its simple name.type - the typeprivate static void registerBySimpleName(Class<?> type, Class<?> nameType)
type by the simple name of nameType, e.g., to map wrappers to their primitive types.type - the typenameType - the type providing the namepublic static de.iip_ecosphere.platform.support.aas.Reference addType(de.iip_ecosphere.platform.support.aas.Aas.AasBuilder aasBuilder,
Class<?> type)
aasBuilder - the AAS buildertype - the type to addprivate static de.iip_ecosphere.platform.support.aas.Reference addType(de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder builder,
Class<?> type)
builder - the target sub-modeltype - the type to addpublic static de.iip_ecosphere.platform.support.aas.SubmodelElement addTypeSubModelElement(de.iip_ecosphere.platform.support.aas.SubmodelElementContainerBuilder subModelBuilder,
String idShort,
Class<?> type)
subModelBuilder - the target sub-modelidShort - the name of the elementtype - the type to represent in the elementpublic static String getName(Class<?> type)
type - the typepublic static String getId(String prefix, Object object)
prefix - an optional prefix, use an empty string for none; shall end with a separator, e.g., "_"object - the object to be turned into a unique idCopyright © 2021. All rights reserved.