Package com.adobe.epubcheck.vocab
Class Property
- java.lang.Object
-
- com.adobe.epubcheck.vocab.Property
-
public final class Property extends java.lang.ObjectRepresents a value of thepropertydatatype, as listed in vocabulary of properties.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringbaseprivate java.lang.Enum<?>enumeeprivate java.lang.StringfullNameprivate java.lang.Stringnameprivate java.lang.StringprefixedNameprivate PropertyStatusstatus
-
Constructor Summary
Constructors Modifier Constructor Description privateProperty(java.lang.String name, java.lang.String base, java.lang.String prefix, java.lang.Enum<?> enumee)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static <E extends java.lang.Enum<E>>
java.util.Set<E>filter(java.util.Set<Property> properties, java.lang.Class<E> clazz)Filters the given set ofPropertyvalues and keeps the values backed by anEnumconstant of the given type.java.lang.StringgetFullName()Returns the full URI value of this property.java.lang.StringgetName()Returns the short name (afa "reference") of this property.java.lang.StringgetPrefixedName()Returns the prefixed name (aka CURIE) of this property.java.lang.StringgetVocabURI()Returns the vocab URI of this property.inthashCode()booleanisAllowed(ValidationContext context)Returns whether this property is allowed in the given validation context.booleanisDeprecated()Returns whether this property is deprecated.static PropertynewFrom(java.lang.String name, java.lang.String base, java.lang.String prefix)Creates a new instance from a short name, a prefix, and a stem URI.static PropertynewFrom(java.lang.String name, java.lang.String base, java.lang.String prefix, java.lang.Enum<?> enumee)Creates a new instance from a short name, a prefix, and a stem URI, and an optionalEnumitem used to represent this property in known vocabularies.java.lang.Enum<?>toEnum()Returns theEnumitem that is used to represent this property in enum-based vocabularies.java.lang.StringtoString()
-
-
-
Field Detail
-
base
private final java.lang.String base
-
name
private final java.lang.String name
-
prefixedName
private final java.lang.String prefixedName
-
fullName
private final java.lang.String fullName
-
enumee
private final java.lang.Enum<?> enumee
-
status
private final PropertyStatus status
-
-
Method Detail
-
newFrom
public static Property newFrom(java.lang.String name, java.lang.String base, java.lang.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(java.lang.String name, java.lang.String base, java.lang.String prefix, java.lang.Enum<?> enumee)
Creates a new instance from a short name, a prefix, and a stem URI, and an optionalEnumitem 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 java.lang.Enum<E>> java.util.Set<E> filter(java.util.Set<Property> properties, java.lang.Class<E> clazz)
Filters the given set ofPropertyvalues and keeps the values backed by anEnumconstant of the given type.- Parameters:
properties- the properties to filterclazz- the class of a vocabulary-backing enum- Returns:
- An immutable
EnumSetrepresenting the filtered properties
-
getName
public java.lang.String getName()
Returns the short name (afa "reference") of this property.- Returns:
- the short name (afa "reference") of this property.
-
getFullName
public java.lang.String getFullName()
Returns the full URI value of this property.- Returns:
- the full URI value of this property.
-
getPrefixedName
public java.lang.String getPrefixedName()
Returns the prefixed name (aka CURIE) of this property.- Returns:
- the prefixed name (aka CURIE) of this property.
-
getVocabURI
public java.lang.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:
trueiff 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:
trueiff the property is deprecated
-
toEnum
public java.lang.Enum<?> toEnum()
Returns theEnumitem that is used to represent this property in enum-based vocabularies.- Returns:
- the
Enumitem that is used to represent this property. - Throws:
java.lang.UnsupportedOperationException- if this property doesn't represent a property from an enum-based vocabulary.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-