Interface TypeFacade
-
- All Known Subinterfaces:
TypeFacadeStrategy
- All Known Implementing Classes:
DefaultTypeFacade
public interface TypeFacadeFacade for loading types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default DataAttributegetAttribute(java.lang.Object object, java.lang.String attributeQualifier)Gets a attribute of given object for given qualifier.default DataAttributegetAttribute(java.lang.String typeCode, java.lang.String attributeQualifier)Gets a attribute of given object for given qualifier.java.lang.StringgetAttributeDescription(java.lang.String type, java.lang.String attribute)Gets attribute description for the given attributejava.lang.StringgetAttributeDescription(java.lang.String type, java.lang.String attribute, java.util.Locale locale)Gets attribute description for the given attributejava.lang.StringgetType(java.lang.Object object)Gets type of given objectDataTypeload(java.lang.String qualifier)Convenience method, calls load(qualifier, null).
Seeload(String, Context).DataTypeload(java.lang.String qualifier, Context ctx)Loads aDataTypefor the given code, if it exists.
-
-
-
Method Detail
-
load
DataType load(java.lang.String qualifier) throws TypeNotFoundException
Convenience method, calls load(qualifier, null).
Seeload(String, Context).- Parameters:
qualifier- A unique qualifier identifying the type.- Returns:
- The type instance for given id loaded with attributes defined in context.
- Throws:
TypeNotFoundException- if there is no type available for the given code.
-
load
DataType load(java.lang.String qualifier, Context ctx) throws TypeNotFoundException
Loads aDataTypefor the given code, if it exists.- Parameters:
qualifier- A unique qualifier identifying the type.ctx- Context specifying the loaded attributes of the returned type as well as application settings.- Returns:
- The type instance for given id loaded with attributes defined in context.
- Throws:
TypeNotFoundException- if there is no type available for the given code.
-
getType
java.lang.String getType(java.lang.Object object)
Gets type of given object- Parameters:
object- a object for which type qualifier should be returned- Returns:
- type qualifier for the given object. If there is no custom type system or the object doesn't belong to it, it returns the java class name.
-
getAttribute
default DataAttribute getAttribute(java.lang.String typeCode, java.lang.String attributeQualifier)
Gets a attribute of given object for given qualifier.As a qualifier may be given any expression compatible with SpEL specification, yet more sophisticated expressions may strongly affect performance. If expression may not be interpreted as item's attribute, a expressions value class is returned.
- Parameters:
typeCode- code of the type for which the attribute's should be fetchedattributeQualifier- attribute qualifier or SpEL- Returns:
- evaluation's result - attribute which is pointed by an expression or
nullif expression does not point an attribute straightforward or is outside of platform domain
-
getAttribute
default DataAttribute getAttribute(java.lang.Object object, java.lang.String attributeQualifier)
Gets a attribute of given object for given qualifier.As a qualifier may be given any expression compatible with SpEL specification, yet more sophisticated expressions may strongly affect performance. If expression may not be interpreted as item's attribute, a expressions value class is returned.
- Parameters:
object- object, which attribute is to be extractedattributeQualifier- attribute qualifier or SpEL- Returns:
- evaluation's result - attribute which is pointed by an expression or
nullif expression does not point an attribute straightforward or is outside of platform domain
-
getAttributeDescription
java.lang.String getAttributeDescription(java.lang.String type, java.lang.String attribute)Gets attribute description for the given attribute- Parameters:
type- code of the type for which the attribute's description should be fetchedattribute- qualifier of the attribute for which the description should be fetched- Returns:
- description of the attribute
-
getAttributeDescription
java.lang.String getAttributeDescription(java.lang.String type, java.lang.String attribute, java.util.Locale locale)Gets attribute description for the given attribute- Parameters:
type- code of the type for which the attribute's description should be fetchedattribute- qualifier of the attribute for which the description should be fetchedlocale- prefered locale - if available the description should be returned in the prefered locale- Returns:
- description of the attribute
-
-