com.sun.jdo.api.persistence.model.jdo
Class FieldGroupElement

java.lang.Object
  extended by com.sun.jdo.api.persistence.model.jdo.PersistenceElement
      extended by com.sun.jdo.api.persistence.model.jdo.PersistenceMemberElement
          extended by com.sun.jdo.api.persistence.model.jdo.FieldGroupElement
All Implemented Interfaces:
FieldElementHolder, PersistenceElementProperties, Comparable
Direct Known Subclasses:
ConcurrencyGroupElement

public abstract class FieldGroupElement
extends PersistenceMemberElement
implements FieldElementHolder

Version:
%I%
Author:
raccah

Nested Class Summary
static interface FieldGroupElement.Impl
          Pluggable implementation of the storage of field element properties.
 
Field Summary
 
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElementProperties
PROP_CARDINALITY, PROP_COLLECTION_CLASS, PROP_DELETE_ACTION, PROP_ELEMENT_CLASS, PROP_FIELDS, PROP_GROUPS, PROP_IDENTITY, PROP_INVERSE_FIELD, PROP_KEY_CLASS, PROP_KEY_FIELD, PROP_MODIFIED, PROP_NAME, PROP_PERSISTENCE, PROP_PREFETCH, PROP_SENSITIVITY, PROP_UPDATE_ACTION
 
Constructor Summary
FieldGroupElement()
          Create new FieldGroupElement with no implementation.
FieldGroupElement(FieldGroupElement.Impl impl, PersistenceClassElement declaringClass)
          Create new FieldGroupElement with the provided implementation.
 
Method Summary
 void addField(PersistenceFieldElement field)
          Add the supplied field to the collection of fields maintained by this holder.
 void addFields(PersistenceFieldElement[] fields)
          Add the supplied fields to the collection of fields maintained by this holder.
 boolean containsField(PersistenceFieldElement field)
          Tests whether the supplied field is in the collection of fields maintained by this holder.
 PersistenceFieldElement getField(String name)
          Returns the field with the supplied name from the collection of fields maintained by this holder.
 PersistenceFieldElement[] getFields()
          Returns the collection of fields maintained by this holder in the form of an array.
 void removeField(PersistenceFieldElement field)
          Remove the supplied field from the collection of fields maintained by this holder.
 void removeFields(PersistenceFieldElement[] fields)
          Removed the supplied fields from the collection of fields maintained by this holder.
 void setFields(PersistenceFieldElement[] fields)
          Sets the collection of fields maintained by this holder to the contents of the supplied array.
 
Methods inherited from class com.sun.jdo.api.persistence.model.jdo.PersistenceMemberElement
equals, getDeclaringClass, hashCode, setDeclaringClass
 
Methods inherited from class com.sun.jdo.api.persistence.model.jdo.PersistenceElement
addPropertyChangeListener, addVetoableChangeListener, compareTo, getImpl, getMessages, getName, removePropertyChangeListener, removeVetoableChangeListener, setImpl, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldGroupElement

public FieldGroupElement()
Create new FieldGroupElement with no implementation. This constructor should only be used for cloning and archiving.


FieldGroupElement

public FieldGroupElement(FieldGroupElement.Impl impl,
                         PersistenceClassElement declaringClass)
Create new FieldGroupElement with the provided implementation. The implementation is responsible for storing all properties of the object.

Parameters:
impl - the implementation to use
declaringClass - the class to attach to
Method Detail

addField

public void addField(PersistenceFieldElement field)
              throws ModelException
Add the supplied field to the collection of fields maintained by this holder.

Specified by:
addField in interface FieldElementHolder
Parameters:
field - the field to be added
Throws:
ModelException - if impossible

addFields

public void addFields(PersistenceFieldElement[] fields)
               throws ModelException
Add the supplied fields to the collection of fields maintained by this holder.

Specified by:
addFields in interface FieldElementHolder
Parameters:
fields - the array of fields to be added
Throws:
ModelException - if impossible

removeField

public void removeField(PersistenceFieldElement field)
                 throws ModelException
Remove the supplied field from the collection of fields maintained by this holder.

Specified by:
removeField in interface FieldElementHolder
Parameters:
field - the field to be removed
Throws:
ModelException - if impossible

removeFields

public void removeFields(PersistenceFieldElement[] fields)
                  throws ModelException
Removed the supplied fields from the collection of fields maintained by this holder.

Specified by:
removeFields in interface FieldElementHolder
Parameters:
fields - the array of fields to be removed
Throws:
ModelException - if impossible

getFields

public PersistenceFieldElement[] getFields()
Returns the collection of fields maintained by this holder in the form of an array.

Specified by:
getFields in interface FieldElementHolder
Returns:
the fields maintained by this holder

setFields

public void setFields(PersistenceFieldElement[] fields)
               throws ModelException
Sets the collection of fields maintained by this holder to the contents of the supplied array.

Specified by:
setFields in interface FieldElementHolder
Parameters:
fields - the fields maintained by this holder
Throws:
ModelException - if impossible

getField

public PersistenceFieldElement getField(String name)
Returns the field with the supplied name from the collection of fields maintained by this holder.

Specified by:
getField in interface FieldElementHolder
Parameters:
name - the name of the field to be found
Returns:
the field with the supplied name, null if none exists

containsField

public boolean containsField(PersistenceFieldElement field)
Tests whether the supplied field is in the collection of fields maintained by this holder.

Specified by:
containsField in interface FieldElementHolder
Parameters:
field - the field to be tested


Copyright © 2012 GlassFish Community. All Rights Reserved.