Class UncheckedVocab

  • All Implemented Interfaces:
    Vocab

    public final class UncheckedVocab
    extends java.lang.Object
    implements Vocab
    A Vocab implementation which always return a successful lookup result. In other words, this represents an "unchecked" vocabulary which assumes that all property names are allowed. It is used to represent user-declared custom vocabularies that are not known to EpubCheck.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String base  
      private java.lang.String prefix  
    • Constructor Summary

      Constructors 
      Constructor Description
      UncheckedVocab​(java.lang.String base, java.lang.String prefix)
      Creates a new unchecked vocabulary representing properties whose URIs start with base and short names have the prefix prefix.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getURI()
      Returns the base URI of this vocabulary.
      com.google.common.base.Optional<Property> lookup​(java.lang.String name)
      Returns a reference to a new Property with the short name name, the same prefix and stem URI as was given when creating this vocabulary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • base

        private final java.lang.String base
      • prefix

        private final java.lang.String prefix
    • Constructor Detail

      • UncheckedVocab

        public UncheckedVocab​(java.lang.String base,
                              java.lang.String prefix)
        Creates a new unchecked vocabulary representing properties whose URIs start with base and short names have the prefix prefix.
        Parameters:
        base - the URI stem used to generate URIs of properties in this vocabulary.
        prefix - the prefix used for property names.
    • Method Detail

      • lookup

        public com.google.common.base.Optional<Property> lookup​(java.lang.String name)
        Returns a reference to a new Property with the short name name, the same prefix and stem URI as was given when creating this vocabulary.
        Specified by:
        lookup in interface Vocab
        Parameters:
        name - the property name (unprefixed).
        Returns:
        an Property reference which contains a Property if the lookup was successful or nothing if the property was not found in this vocabulary.
      • getURI

        public java.lang.String getURI()
        Description copied from interface: Vocab
        Returns the base URI of this vocabulary.
        Specified by:
        getURI in interface Vocab
        Returns:
        the base URI of this vocabulary.