Class Extensions

java.lang.Object
org.apache.openjpa.meta.Extensions
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ClassMetaData, FieldMetaData

public abstract class Extensions extends Object implements Serializable
Vendor extensions. This class is thread safe for reads, but not for mutations.
Author:
Abe White
See Also:
  • Field Details

  • Constructor Details

    • Extensions

      public Extensions()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Return true if there are no keys for any vendor.
    • getExtensionVendors

      public String[] getExtensionVendors()
      Return all vendors who have extension keys at this level.
    • getExtensionKeys

      public String[] getExtensionKeys()
      Return all extension keys.
    • getExtensionKeys

      public String[] getExtensionKeys(String vendor)
      Return all extension keys for the given vendor.
    • hasExtension

      public boolean hasExtension(String key)
      Return true if the extension with the given key exists.
    • hasExtension

      public boolean hasExtension(String vendor, String key)
      Return true if the extension with the given key exists.
    • addExtension

      public void addExtension(String key, Object value)
      Add a vendor extension to this entity.
    • addExtension

      public void addExtension(String vendor, String key, Object value)
      Add a vendor extension to this entity.
    • removeExtension

      public boolean removeExtension(String key)
      Remove a vendor extension.
    • removeExtension

      public boolean removeExtension(String vendor, String key)
      Remove a vendor extension.
    • getObjectExtension

      public Object getObjectExtension(String key)
      Get the value of an extension.
    • getObjectExtension

      public Object getObjectExtension(String vendor, String key)
      Get the value of an extension.
    • getStringExtension

      public String getStringExtension(String key)
      Get the value as a string.
    • getStringExtension

      public String getStringExtension(String vendor, String key)
      Get the value as a string.
    • getIntExtension

      public int getIntExtension(String key)
      Get the value as an int.
    • getIntExtension

      public int getIntExtension(String vendor, String key)
      Get the value as an int.
    • getDoubleExtension

      public double getDoubleExtension(String key)
      Get the value as a double.
    • getDoubleExtension

      public double getDoubleExtension(String vendor, String key)
      Get the value as a double.
    • getBooleanExtension

      public boolean getBooleanExtension(String key)
      Get the value as a boolean.
    • getBooleanExtension

      public boolean getBooleanExtension(String vendor, String key)
      Get the value as a boolean.
    • getEmbeddedExtensions

      public Extensions getEmbeddedExtensions(String key, boolean create)
      Return the embedded extensions under the given key.
    • getEmbeddedExtensions

      public Extensions getEmbeddedExtensions(String vendor, String key, boolean create)
      Return the embedded extensions under the given key.
    • removeEmbeddedExtensions

      public boolean removeEmbeddedExtensions(String key)
    • removeEmbeddedExtensions

      public boolean removeEmbeddedExtensions(String vendor, String key)
    • copy

      protected void copy(Extensions exts)
      Copy the extensions not present in this instance but present in the given instance.
    • validateExtensionKeys

      public void validateExtensionKeys()
      Helper method to issue warnings for any extensions that we recognize but do not use.
      Since:
      0.3.1.3
    • addExtensionKeys

      protected void addExtensionKeys(Collection exts)
      Add all the known extension keys to the specified collection; any implementation that utilized new extensions should override this method to include both the known extensions of its superclass as well as its own extension keys.
      Since:
      0.3.1.3
    • validateDataStoreExtensionPrefix

      protected boolean validateDataStoreExtensionPrefix(String prefix)
      Return true if extensions starting with the given official datastore prefix should be validated for this runtime.
    • getRepository

      public abstract MetaDataRepository getRepository()
      Return the metadata repository.