org.apache.openjpa.meta
Class Extensions

java.lang.Object
  extended by 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:
Serialized Form

Field Summary
static String OPENJPA
           
 
Constructor Summary
Extensions()
           
 
Method Summary
 void addExtension(String key, Object value)
          Add a vendor extension to this entity.
 void addExtension(String vendor, String key, Object value)
          Add a vendor extension to this entity.
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.
protected  void copy(Extensions exts)
          Copy the extensions not present in this instance but present in the given instance.
 boolean getBooleanExtension(String key)
          Get the value as a boolean.
 boolean getBooleanExtension(String vendor, String key)
          Get the value as a boolean.
 double getDoubleExtension(String key)
          Get the value as a double.
 double getDoubleExtension(String vendor, String key)
          Get the value as a double.
 Extensions getEmbeddedExtensions(String key, boolean create)
          Return the embedded extensions under the given key.
 Extensions getEmbeddedExtensions(String vendor, String key, boolean create)
          Return the embedded extensions under the given key.
 String[] getExtensionKeys()
          Return all extension keys.
 String[] getExtensionKeys(String vendor)
          Return all extension keys for the given vendor.
 String[] getExtensionVendors()
          Return all vendors who have extension keys at this level.
 int getIntExtension(String key)
          Get the value as an int.
 int getIntExtension(String vendor, String key)
          Get the value as an int.
 Object getObjectExtension(String key)
          Get the value of an extension.
 Object getObjectExtension(String vendor, String key)
          Get the value of an extension.
abstract  MetaDataRepository getRepository()
          Return the metadata repository.
 String getStringExtension(String key)
          Get the value as a string.
 String getStringExtension(String vendor, String key)
          Get the value as a string.
 boolean hasExtension(String key)
          Return true if the extension with the given key exists.
 boolean hasExtension(String vendor, 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(String key)
           
 boolean removeEmbeddedExtensions(String vendor, String key)
           
 boolean removeExtension(String key)
          Remove a vendor extension.
 boolean removeExtension(String vendor, String key)
          Remove a vendor extension.
protected  boolean validateDataStoreExtensionPrefix(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPENJPA

public static final String OPENJPA
See Also:
Constant Field Values
Constructor Detail

Extensions

public Extensions()
Method Detail

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.



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.