Interface Mapper

    • Method Detail

      • serializedClass

        java.lang.String serializedClass​(java.lang.Class type)
        How a class name should be represented in its serialized form.
      • realClass

        java.lang.Class realClass​(java.lang.String elementName)
        How a serialized class representation should be mapped back to a real class.
      • serializedMember

        java.lang.String serializedMember​(java.lang.Class type,
                                          java.lang.String memberName)
        How a class member should be represented in its serialized form.
      • realMember

        java.lang.String realMember​(java.lang.Class type,
                                    java.lang.String serialized)
        How a serialized member representation should be mapped back to a real member.
      • isImmutableValueType

        boolean isImmutableValueType​(java.lang.Class type)
        Whether this type is a simple immutable value (int, boolean, String, URL, etc). Immutable types will be repeatedly written in the serialized stream, instead of using object references.
      • isReferenceable

        boolean isReferenceable​(java.lang.Class type)
        Whether this type is referenceable in a stream.
        Since:
        1.4.9
      • defaultImplementationOf

        java.lang.Class defaultImplementationOf​(java.lang.Class type)
      • aliasForAttribute

        java.lang.String aliasForAttribute​(java.lang.String attribute)
        Get the alias for an attribute's name.
        Parameters:
        attribute - the attribute
        Returns:
        the alias
        Since:
        1.2
      • attributeForAlias

        java.lang.String attributeForAlias​(java.lang.String alias)
        Get the attribute's name for an alias.
        Parameters:
        alias - the alias
        Returns:
        the attribute's name
        Since:
        1.2
      • aliasForSystemAttribute

        java.lang.String aliasForSystemAttribute​(java.lang.String attribute)
        Get the alias for a system attribute's name.
        Parameters:
        attribute - the system attribute
        Returns:
        the alias
        Since:
        1.3.1
      • getFieldNameForItemTypeAndName

        java.lang.String getFieldNameForItemTypeAndName​(java.lang.Class definedIn,
                                                        java.lang.Class itemType,
                                                        java.lang.String itemFieldName)
        Get the name of the field that acts as the default collection for an object, or return null if there is none.
        Parameters:
        definedIn - owning type
        itemType - item type
        itemFieldName - optional item element name
      • getItemTypeForItemFieldName

        java.lang.Class getItemTypeForItemFieldName​(java.lang.Class definedIn,
                                                    java.lang.String itemFieldName)
      • getImplicitCollectionDefForFieldName

        Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName​(java.lang.Class itemType,
                                                                              java.lang.String fieldName)
      • shouldSerializeMember

        boolean shouldSerializeMember​(java.lang.Class definedIn,
                                      java.lang.String fieldName)
        Determine whether a specific member should be serialized.
        Since:
        1.1.3
      • isIgnoredElement

        boolean isIgnoredElement​(java.lang.String name)
        Whether this name can be ignored.
        Since:
        1.4.9
      • getLocalConverter

        Converter getLocalConverter​(java.lang.Class definedIn,
                                    java.lang.String fieldName)
      • lookupMapperOfType

        Mapper lookupMapperOfType​(java.lang.Class type)
      • getConverterFromItemType

        SingleValueConverter getConverterFromItemType​(java.lang.String fieldName,
                                                      java.lang.Class type,
                                                      java.lang.Class definedIn)
        Returns a single value converter to be used in a specific field.
        Parameters:
        fieldName - the field name
        type - the field type
        definedIn - the type which defines this field
        Returns:
        a SingleValueConverter or null if there no such converter should be used for this field.
        Since:
        1.2.2
      • aliasForAttribute

        java.lang.String aliasForAttribute​(java.lang.Class definedIn,
                                           java.lang.String fieldName)
        Returns an alias for a single field defined in an specific type.
        Parameters:
        definedIn - the type where the field was defined
        fieldName - the field name
        Returns:
        the alias for this field or its own name if no alias was defined
        Since:
        1.2.2
      • attributeForAlias

        java.lang.String attributeForAlias​(java.lang.Class definedIn,
                                           java.lang.String alias)
        Deprecated.
        Returns the field name for an aliased attribute.
        Parameters:
        definedIn - the type where the field was defined
        alias - the alias
        Returns:
        the original attribute name
        Since:
        1.2.2
      • getConverterFromAttribute

        SingleValueConverter getConverterFromAttribute​(java.lang.Class definedIn,
                                                       java.lang.String attribute)
        Returns which converter to use for an specific attribute in a type.
        Parameters:
        definedIn - the field's parent
        attribute - the attribute name
      • getConverterFromAttribute

        SingleValueConverter getConverterFromAttribute​(java.lang.Class definedIn,
                                                       java.lang.String attribute,
                                                       java.lang.Class type)
        Returns which converter to use for an specific attribute in a type.
        Parameters:
        definedIn - the field's parent
        attribute - the attribute name
        type - the type the converter should create
        Since:
        1.3.1