Interface TypeFacade

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default DataAttribute getAttribute​(java.lang.Object object, java.lang.String attributeQualifier)
      Gets a attribute of given object for given qualifier.
      default DataAttribute getAttribute​(java.lang.String typeCode, java.lang.String attributeQualifier)
      Gets a attribute of given object for given qualifier.
      java.lang.String getAttributeDescription​(java.lang.String type, java.lang.String attribute)
      Gets attribute description for the given attribute
      java.lang.String getAttributeDescription​(java.lang.String type, java.lang.String attribute, java.util.Locale locale)
      Gets attribute description for the given attribute
      java.lang.String getType​(java.lang.Object object)
      Gets type of given object
      DataType load​(java.lang.String qualifier)
      Convenience method, calls load(qualifier, null).
      See load(String, Context).
      DataType load​(java.lang.String qualifier, Context ctx)
      Loads a DataType for the given code, if it exists.
    • Method Detail

      • load

        DataType load​(java.lang.String qualifier)
               throws TypeNotFoundException
        Convenience method, calls load(qualifier, null).
        See load(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 a DataType for 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 fetched
        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
      • 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 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
      • 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 fetched
        attribute - 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 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