Class Property

java.lang.Object
com.adobe.epubcheck.vocab.Property

public final class Property extends Object
Represents a value of the property datatype, as listed in vocabulary of properties.
  • Field Details

    • base

      private final String base
    • name

      private final String name
    • prefixedName

      private final String prefixedName
    • fullName

      private final String fullName
    • enumee

      private final Enum<?> enumee
    • status

      private final PropertyStatus status
  • Constructor Details

  • Method Details

    • newFrom

      public static Property newFrom(String name, String base, String prefix)
      Creates a new instance from a short name, a prefix, and a stem URI.
      Parameters:
      name - the short name of the property (aka "reference").
      base - the stem URI used to compute the full URI value.
      prefix - the prefix used in the CURIE form.
      Returns:
    • newFrom

      public static Property newFrom(String name, String base, String prefix, Enum<?> enumee)
      Creates a new instance from a short name, a prefix, and a stem URI, and an optional Enum item used to represent this property in known vocabularies.
      Parameters:
      name - the short name of the property (aka "reference").
      base - the stem URI used to compute the full URI value.
      prefix - the prefix used in the CURIE form.
      Returns:
    • filter

      public static <E extends Enum<E>> Set<E> filter(Set<Property> properties, Class<E> clazz)
      Filters the given set of Property values and keeps the values backed by an Enum constant of the given type.
      Parameters:
      properties - the properties to filter
      clazz - the class of a vocabulary-backing enum
      Returns:
      An immutable EnumSet representing the filtered properties
    • getName

      public String getName()
      Returns the short name (afa "reference") of this property.
      Returns:
      the short name (afa "reference") of this property.
    • getFullName

      public String getFullName()
      Returns the full URI value of this property.
      Returns:
      the full URI value of this property.
    • getPrefixedName

      public String getPrefixedName()
      Returns the prefixed name (aka CURIE) of this property.
      Returns:
      the prefixed name (aka CURIE) of this property.
    • getVocabURI

      public String getVocabURI()
      Returns the vocab URI of this property.
      Returns:
      the URI of the vocab where this property is defined
    • isAllowed

      public boolean isAllowed(ValidationContext context)
      Returns whether this property is allowed in the given validation context. Disallowed properties are reported as ERRORs.
      Parameters:
      context - the validation context (locale, path, etc).
      Returns:
      true iff the property is allowed in the given context
    • isDeprecated

      public boolean isDeprecated()
      Returns whether this property is deprecated. Deprecated properties are reported as WARNINGs.
      Returns:
      true iff the property is deprecated
    • toEnum

      public Enum<?> toEnum()
      Returns the Enum item that is used to represent this property in enum-based vocabularies.
      Returns:
      the Enum item that is used to represent this property.
      Throws:
      UnsupportedOperationException - if this property doesn't represent a property from an enum-based vocabulary.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object