Package org.apache.openjpa.meta
Class Extensions
- java.lang.Object
-
- org.apache.openjpa.meta.Extensions
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ClassMetaData
,FieldMetaData
public abstract class Extensions extends java.lang.Object implements java.io.Serializable
Vendor extensions. This class is thread safe for reads, but not for mutations.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OPENJPA
-
Constructor Summary
Constructors Constructor Description Extensions()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addExtension(java.lang.String key, java.lang.Object value)
Add a vendor extension to this entity.void
addExtension(java.lang.String vendor, java.lang.String key, java.lang.Object value)
Add a vendor extension to this entity.protected void
addExtensionKeys(java.util.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.protected void
copy(Extensions exts)
Copy the extensions not present in this instance but present in the given instance.boolean
getBooleanExtension(java.lang.String key)
Get the value as a boolean.boolean
getBooleanExtension(java.lang.String vendor, java.lang.String key)
Get the value as a boolean.double
getDoubleExtension(java.lang.String key)
Get the value as a double.double
getDoubleExtension(java.lang.String vendor, java.lang.String key)
Get the value as a double.Extensions
getEmbeddedExtensions(java.lang.String key, boolean create)
Return the embedded extensions under the given key.Extensions
getEmbeddedExtensions(java.lang.String vendor, java.lang.String key, boolean create)
Return the embedded extensions under the given key.java.lang.String[]
getExtensionKeys()
Return all extension keys.java.lang.String[]
getExtensionKeys(java.lang.String vendor)
Return all extension keys for the given vendor.java.lang.String[]
getExtensionVendors()
Return all vendors who have extension keys at this level.int
getIntExtension(java.lang.String key)
Get the value as an int.int
getIntExtension(java.lang.String vendor, java.lang.String key)
Get the value as an int.java.lang.Object
getObjectExtension(java.lang.String key)
Get the value of an extension.java.lang.Object
getObjectExtension(java.lang.String vendor, java.lang.String key)
Get the value of an extension.abstract MetaDataRepository
getRepository()
Return the metadata repository.java.lang.String
getStringExtension(java.lang.String key)
Get the value as a string.java.lang.String
getStringExtension(java.lang.String vendor, java.lang.String key)
Get the value as a string.boolean
hasExtension(java.lang.String key)
Return true if the extension with the given key exists.boolean
hasExtension(java.lang.String vendor, java.lang.String key)
Return true if the extension with the given key exists.boolean
isEmpty()
Return true if there are no keys for any vendor.boolean
removeEmbeddedExtensions(java.lang.String key)
boolean
removeEmbeddedExtensions(java.lang.String vendor, java.lang.String key)
boolean
removeExtension(java.lang.String key)
Remove a vendor extension.boolean
removeExtension(java.lang.String vendor, java.lang.String key)
Remove a vendor extension.protected boolean
validateDataStoreExtensionPrefix(java.lang.String prefix)
Return true if extensions starting with the given official datastore prefix should be validated for this runtime.void
validateExtensionKeys()
Helper method to issue warnings for any extensions that we recognize but do not use.
-
-
-
Field Detail
-
OPENJPA
public static final java.lang.String OPENJPA
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Return true if there are no keys for any vendor.
-
getExtensionVendors
public java.lang.String[] getExtensionVendors()
Return all vendors who have extension keys at this level.
-
getExtensionKeys
public java.lang.String[] getExtensionKeys()
Return all extension keys.
-
getExtensionKeys
public java.lang.String[] getExtensionKeys(java.lang.String vendor)
Return all extension keys for the given vendor.
-
hasExtension
public boolean hasExtension(java.lang.String key)
Return true if the extension with the given key exists.
-
hasExtension
public boolean hasExtension(java.lang.String vendor, java.lang.String key)
Return true if the extension with the given key exists.
-
addExtension
public void addExtension(java.lang.String key, java.lang.Object value)
Add a vendor extension to this entity.
-
addExtension
public void addExtension(java.lang.String vendor, java.lang.String key, java.lang.Object value)
Add a vendor extension to this entity.
-
removeExtension
public boolean removeExtension(java.lang.String key)
Remove a vendor extension.
-
removeExtension
public boolean removeExtension(java.lang.String vendor, java.lang.String key)
Remove a vendor extension.
-
getObjectExtension
public java.lang.Object getObjectExtension(java.lang.String key)
Get the value of an extension.
-
getObjectExtension
public java.lang.Object getObjectExtension(java.lang.String vendor, java.lang.String key)
Get the value of an extension.
-
getStringExtension
public java.lang.String getStringExtension(java.lang.String key)
Get the value as a string.
-
getStringExtension
public java.lang.String getStringExtension(java.lang.String vendor, java.lang.String key)
Get the value as a string.
-
getIntExtension
public int getIntExtension(java.lang.String key)
Get the value as an int.
-
getIntExtension
public int getIntExtension(java.lang.String vendor, java.lang.String key)
Get the value as an int.
-
getDoubleExtension
public double getDoubleExtension(java.lang.String key)
Get the value as a double.
-
getDoubleExtension
public double getDoubleExtension(java.lang.String vendor, java.lang.String key)
Get the value as a double.
-
getBooleanExtension
public boolean getBooleanExtension(java.lang.String key)
Get the value as a boolean.
-
getBooleanExtension
public boolean getBooleanExtension(java.lang.String vendor, java.lang.String key)
Get the value as a boolean.
-
getEmbeddedExtensions
public Extensions getEmbeddedExtensions(java.lang.String key, boolean create)
Return the embedded extensions under the given key.
-
getEmbeddedExtensions
public Extensions getEmbeddedExtensions(java.lang.String vendor, java.lang.String key, boolean create)
Return the embedded extensions under the given key.
-
removeEmbeddedExtensions
public boolean removeEmbeddedExtensions(java.lang.String key)
-
removeEmbeddedExtensions
public boolean removeEmbeddedExtensions(java.lang.String vendor, java.lang.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(java.util.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(java.lang.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.
-
-