Class DefaultTypeFacade

    • Constructor Detail

      • DefaultTypeFacade

        public DefaultTypeFacade()
    • Method Detail

      • load

        public DataType load​(java.lang.String qualifier,
                             Context ctx)
                      throws TypeNotFoundException
        Description copied from interface: TypeFacade
        Loads a DataType for the given code, if it exists.
        Specified by:
        load in interface TypeFacade
        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

        public java.lang.String getType​(java.lang.Object object)
        Description copied from interface: TypeFacade
        Gets type of given object
        Specified by:
        getType in interface TypeFacade
        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.
      • getAttributeDescription

        public java.lang.String getAttributeDescription​(java.lang.String type,
                                                        java.lang.String attribute)
        Description copied from interface: TypeFacade
        Gets attribute description for the given attribute
        Specified by:
        getAttributeDescription in interface TypeFacade
        Parameters:
        type - code of the type for which the attribute's description should be fetched
        attribute - qualifier of the attribute for which the description should be fetched
        Returns:
        description of the attribute
      • getAttributeDescription

        public java.lang.String getAttributeDescription​(java.lang.String type,
                                                        java.lang.String attribute,
                                                        java.util.Locale locale)
        Description copied from interface: TypeFacade
        Gets attribute description for the given attribute
        Specified by:
        getAttributeDescription in interface TypeFacade
        Parameters:
        type - code of the type for which the attribute's description should be fetched
        attribute - qualifier of the attribute for which the description should be fetched
        locale - prefered locale - if available the description should be returned in the prefered locale
        Returns:
        description of the attribute
      • getAttribute

        public DataAttribute getAttribute​(java.lang.Object object,
                                          java.lang.String attributeQualifier)
        Description copied from interface: TypeFacade
        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.

        Specified by:
        getAttribute in interface TypeFacade
        Parameters:
        object - object, which attribute is to be extracted
        attributeQualifier - attribute qualifier or SpEL
        Returns:
        evaluation's result - attribute which is pointed by an expression or null if expression does not point an attribute straightforward or is outside of platform domain