Class StandardMetaIdentifierTransformer

java.lang.Object
is.galia.image.StandardMetaIdentifierTransformer
All Implemented Interfaces:
MetaIdentifierTransformer

public final class StandardMetaIdentifierTransformer extends Object implements MetaIdentifierTransformer

Transforms meta-identifiers to or from one of the following formats:

  • Identifier
  • Identifier;PageNumber
  • Identifier;ScaleConstraint
  • Identifier;PageNumber;ScaleConstraint

(The ; character is customizable via the Key.STANDARD_META_IDENTIFIER_TRANSFORMER_DELIMITER configuration key.)

  • Constructor Details

    • StandardMetaIdentifierTransformer

      public StandardMetaIdentifierTransformer()
  • Method Details

    • deserialize

      public MetaIdentifier deserialize(String metaIdentifier)
      Breaks apart the given meta-identifier into its constituent components.
      Specified by:
      deserialize in interface MetaIdentifierTransformer
      Parameters:
      metaIdentifier - Meta-identifier string to deserialize. The string has already been URL-decoded and had slashes substituted.
    • serialize

      public String serialize(MetaIdentifier metaIdentifier)
      Joins the give instance into a meta-identifier string.
      Specified by:
      serialize in interface MetaIdentifierTransformer
      Parameters:
      metaIdentifier - Instance to serialize.
      Returns:
      Serialized instance, not yet URL-encoded or with slashes substituted.
    • serialize

      public String serialize(MetaIdentifier metaIdentifier, boolean normalize)
      Joins the give instance into a meta-identifier string.
      Parameters:
      metaIdentifier - Instance to serialize.
      normalize - Whether to omit redundant information (such as a page number of 1) from the result. This is used in testing.