public class CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem,DESCRIPTOR extends CoreDescriptor> extends Object implements Serializable, Cloneable
AttributeGroup
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Map<Object,CoreAttributeGroup> |
allsubclasses
This attribute is used to store all of the classes in this hierarchy keyed by type.
|
protected boolean |
isValidated
Marks this AttributeGroup as having been validated by the builder and does not require further validation
|
protected Map<String,ATTRIBUTE_ITEM> |
items
Specified attributes in the group mapped to their AttributeItems
|
protected String |
name
Name of the group.
|
protected Set<CoreAttributeGroup> |
subClasses
This attribute references the immediate subclass groups for this attributeGroup.
|
protected CoreAttributeGroup |
superClassGroup
To add inheritance support the two following attrbutes are used to create a model of the inheritance tree
This attribute points to the parent AttributeGroup of this attribute group.
|
protected Class |
type
The class represented by this AttrbuteGroup.
|
protected String |
typeName
The name of the class represented by this AttrbuteGroup.
|
Constructor and Description |
---|
CoreAttributeGroup() |
CoreAttributeGroup(String name) |
CoreAttributeGroup(String name,
Class type,
boolean isValidated)
INTERNAL:
This constructer is to only be used by EclipseLink internally
|
CoreAttributeGroup(String name,
String type,
boolean isValidated) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String attributeNameOrPath)
Add a basic attribute or nested attribute with each String representing
an attribute on the path to what needs to be included in the
AttributeGroup.
|
void |
addAttribute(String attributeNameOrPath,
Collection<? extends CoreAttributeGroup> groups)
Add an attribute and the corresponding list of AttributeGroups.
|
void |
addAttribute(String attributeNameOrPath,
CoreAttributeGroup group)
Add a basic attribute or nested attribute with each String representing
an attribute on the path to what needs to be included in the
AttributeGroup.
|
void |
addAttributeKey(String attributeNameOrPath,
CoreAttributeGroup group)
Add a basic attribute or nested attribute with each String representing
the key of an attribute of type Map on the path to what needs to be
included in the AttributeGroup.
|
void |
addAttributes(Collection<String> attrOrPaths)
Add a set of attributes to the group.
|
CoreAttributeGroup |
clone() |
CoreAttributeGroup |
clone(Map<CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>,CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>> cloneMap)
INTERNAL:
This method is used internally in the clone processing.
|
boolean |
containsAttribute(String attributeNameOrPath)
Return if the attribute is defined in the group.
|
boolean |
containsAttributeInternal(String attributeName)
INTERNAL:
Return if the attribute is defined in the group.
|
protected String[] |
convert(String... nameOrPath)
Convert a provided name or path which could be a single attributeName, a
single string with dot separated attribute names, or an array of
attribute names defining the path.
|
void |
convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL:
Convert all the class-name-based settings in this Descriptor to actual class-based
settings.
|
boolean |
equals(Object obj) |
CoreAttributeGroup |
findGroup(DESCRIPTOR type) |
Map<String,ATTRIBUTE_ITEM> |
getAllItems()
INTERNAL:
|
Set<String> |
getAttributeNames() |
CoreAttributeGroup |
getGroup(String attributeNameOrPath)
Returns AttributeGroup corresponding to the passed (possibly nested)
attribute.
|
ATTRIBUTE_ITEM |
getItem(String attributeNameOrPath)
INTERNAL:
Lookup the
AttributeItem for the provided attribute name or path. |
protected ATTRIBUTE_ITEM |
getItem(String[] attributePath,
boolean create)
Locate the AttributeGroup where the leaf attribute in the path should be
applied to.
|
Map<String,ATTRIBUTE_ITEM> |
getItems()
INTERNAL:
|
String |
getName() |
Map<Object,CoreAttributeGroup> |
getSubClassGroups()
INTERNAL:
|
Class |
getType() |
String |
getTypeName()
INTERNAL:
Returns the name of the type this group represents
|
int |
hashCode() |
boolean |
hasInheritance()
Indicates whether this group is part of an inheritance hierarchy
|
boolean |
hasItems()
Indicates whether the group has at least one attribute.
|
void |
insertSubClass(CoreAttributeGroup group)
INTERNAL:
This method will insert the group into the entity hierarchy just below this AttributeGroup.
|
boolean |
isConcurrent()
INTERNAL:
Only LoadGroups allow concurrency.
|
boolean |
isCopyGroup()
INTERNAL:
This method is used internally when converting to a copy group.
|
boolean |
isFetchGroup() |
boolean |
isLoadGroup() |
boolean |
isSupersetOf(CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR> anotherGroup)
Return true if this AttributeGroup is a super-set of the passed in
AttributeGroup.
|
boolean |
isValidated()
INTERNAL:
|
protected CoreAttributeGroup |
newGroup(String name,
CoreAttributeGroup parent)
Subclass may create different types.
|
protected CoreAttributeItem |
newItem(CoreAttributeGroup group,
String attrName)
Subclass may create different types.
|
void |
removeAttribute(String attributeNameOrPath)
Remove an attribute from the group.
|
void |
setAllSubclasses(Map<Object,CoreAttributeGroup> subclasses)
INTERNAL:
|
void |
setAttributeNames(Set attributeNames) |
void |
setName(String name) |
String |
toString() |
protected String |
toStringAdditionalInfo()
Used by toString to print additional info for derived classes.
|
protected String |
toStringItems()
Used by toString to print attribute items.
|
protected static String |
toStringPath(String[] attributePath,
int position) |
protected String name
protected String typeName
protected Class type
protected CoreAttributeGroup superClassGroup
protected transient Set<CoreAttributeGroup> subClasses
protected Map<Object,CoreAttributeGroup> allsubclasses
protected Map<String,ATTRIBUTE_ITEM extends CoreAttributeItem> items
protected boolean isValidated
public CoreAttributeGroup(String name)
public CoreAttributeGroup(String name, Class type, boolean isValidated)
name
- type
- public CoreAttributeGroup()
public void addAttribute(String attributeNameOrPath)
Example:
group.addAttribute("firstName");
group.addAttribute("manager.address");
attributeNameOrPath
- A simple attribute, array or attributes forming a pathpublic void addAttribute(String attributeNameOrPath, Collection<? extends CoreAttributeGroup> groups)
attributeNameOrPath
- A simple attribute, array or attributes forming a pathgroups
- - a collection of AttributeGroups to be added.public void addAttribute(String attributeNameOrPath, CoreAttributeGroup group)
Example:
group.addAttribute("firstName", group1);
Note that existing group corresponding to attributeNameOrPath
will be overridden with the passed group.
group.addAttribute("manager.address", group2);
attributeNameOrPath
- A simple attribute, array or attributes forming a pathgroup
- - an AttributeGroup to be added.public void addAttributeKey(String attributeNameOrPath, CoreAttributeGroup group)
Example:
group.addAttribute("firstName", group1);
Note that existing group corresponding to attributeNameOrPath will be
overridden with the passed group.
group.addAttribute("manager.address", group2);
attributeNameOrPath
- A simple attribute, array or attributes forming a path to a
Map keygroup
- - an AttributeGroup to be added.public void addAttributes(Collection<String> attrOrPaths)
public CoreAttributeGroup clone()
public CoreAttributeGroup clone(Map<CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>,CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>> cloneMap)
cloneMap
- public boolean containsAttribute(String attributeNameOrPath)
public boolean containsAttributeInternal(String attributeName)
protected String[] convert(String... nameOrPath)
IllegalArgumentException
- if name is not valid attribute name or path.public void convertClassNamesToClasses(ClassLoader classLoader)
classLoader
- public CoreAttributeGroup findGroup(DESCRIPTOR type)
public Map<String,ATTRIBUTE_ITEM> getAllItems()
public CoreAttributeGroup getGroup(String attributeNameOrPath)
public ATTRIBUTE_ITEM getItem(String attributeNameOrPath)
AttributeItem
for the provided attribute name or path.IllegalArgumentException
- if name is not valid attribute name or pathprotected ATTRIBUTE_ITEM getItem(String[] attributePath, boolean create)
create
- indicates if intermediate AttributeGroup required within the
specified path should be created as needed. When checking the
state of the map callers should set this to false to avoid
changing the state unexpectedlypublic Map<String,ATTRIBUTE_ITEM> getItems()
public String getName()
public Map<Object,CoreAttributeGroup> getSubClassGroups()
public Class getType()
public String getTypeName()
public boolean hasInheritance()
public boolean hasItems()
public void insertSubClass(CoreAttributeGroup group)
group
- public boolean isConcurrent()
public boolean isCopyGroup()
public boolean isFetchGroup()
public boolean isLoadGroup()
public boolean isSupersetOf(CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR> anotherGroup)
public boolean isValidated()
protected CoreAttributeGroup newGroup(String name, CoreAttributeGroup parent)
protected CoreAttributeItem newItem(CoreAttributeGroup group, String attrName)
public void removeAttribute(String attributeNameOrPath)
public void setAllSubclasses(Map<Object,CoreAttributeGroup> subclasses)
public void setAttributeNames(Set attributeNames)
public void setName(String name)
protected String toStringAdditionalInfo()
protected String toStringItems()
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.