public class ClassObject extends BaseModelObject implements IClassObjectData, IClassObjectAction
Modifier and Type | Field and Description |
---|---|
protected ClassObjectAction |
action |
protected List<AssociationEndObject> |
associations |
protected List<AttributeObject> |
attributes |
protected List<MethodObject> |
businessMethods |
protected ContainerObject |
containmentContext |
protected ClassObjectData |
data |
protected boolean |
hasForcedIdentity |
protected boolean |
isInterface |
canBeGenerated, canBeVersioned, displayName, documentation, fromXMLFile, isAbstract, isLeaf, isRoot, isUserCreateable, isUserDefined, isUserDeletable, isUserEditable, name, noDuplicates, packageName, parentName, source, stereotype, superTypes
tags
Constructor and Description |
---|
ClassObject()
Default constructor
Binds it with its data handler and its action handler
|
ClassObject(ClassObject classObject)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(AssociationEndObject association)
Add association
|
static ClassObject |
addAssociationsHelper(ClassObject classObject,
List<AssociationEndObject> associations)
Helper method to appropriately addAssociations with sibling fix-up when there
|
void |
addAttribute(AttributeObject attribute)
Add attribute
|
void |
addMethod(MethodObject method)
Add the MethodObject
|
void |
applySelfToAssociations()
Walk the contained associations and apply this instance to it as the ownning
ClassObject
|
void |
copy(ClassObject c)
Performs a deep copy of all attributes including Collections
|
AttributeObject |
findAttribute(String attributeName)
Locates the attribute with the designated name.
|
AttributeObject |
findAttributeAsBestFitName()
Locate which attribute is best used to designate the name of this attribute
|
void |
finishLoading()
A sub-class will likely have something to do here
|
List<AggregateAttributeObject> |
getAggregateAttributes()
Returns the attributes designated as aggregates.
|
List<List> |
getAggregateAttributesAsAttributes()
Returns a List of aggregate attribute lists.
|
List<ClassObject> |
getAllClassesInHierarchy()
Returns an empty list since from a hierarchy perspective, a class has no
children that themselves are possible a root.
|
List<AttributeObject> |
getAllComposites()
Returns all Composite AttributeObjects in this instance's hierarchy
|
List<BaseModelObject> |
getAllInHierarchy()
Returns an empty list since from a hierarchy perspective, a class has no
children that themselves are possible a root.
|
List<AttributeObject> |
getAllKeyFieldsInHierchy(List<AttributeObject> coll)
Returns all key fields in the hierarchy
|
protected List<? extends BaseModelObject> |
getAllOfLikeType()
Returns all Classes within this hierarchy
|
List<AttributeObject> |
getAllPrimaryKeysInHierarchy()
Returns all primary key AttributeObjects in this instance's hierarchy
|
AssociationEndObject |
getAssociation(String roleName)
Returns the association with the roleName.
|
List<AssociationEndObject> |
getAssociations()
Returns the associations field.
|
List<String> |
getAssociationTypes()
Return all the types of the contained associations
|
List<String> |
getAssociationTypes(String excludeType)
Return the types of the contained associations, excluding those with a type
that matches the input arg
|
List<AttributeObject> |
getAttributes()
Returns the attributes with order.
|
List<AttributeObject> |
getAttributes(boolean includePrimaryKeys)
Returns the attributes, conditionally including the primary keys.
|
String |
getAttributesAsString(boolean bIncludePrimaryKeys,
boolean bIncludeTypes,
boolean bIncludeAssociations,
String delim,
String suffix)
Builds a String using the attribute names and optionally types.
|
List<AttributeObject> |
getAttributesOnly(boolean includeHierarchy,
boolean includePKs)
Helper method to return a list of only attributes, excluding Composites.
|
List<AttributeObject> |
getAttributesOrdered(boolean includePKs)
Returns the attributes order, optionally include the primary key attributes
|
List<List> |
getAttributesOrderedAsCollectionsInHierarchy(boolean includePKs)
Returns all attributes ordered as Collections within this instance's
hierarchy
|
List<AttributeObject> |
getAttributesOrderedInHierarchy()
Returns all attributes ordered within this instance's hierarchy
|
List<AttributeObject> |
getAttributesOrderedInHierarchy(boolean includePKs)
Returns all attributes ordered within this instance's hierarchy
|
List<AttributeObject> |
getAttributesOrderedInHierarchyHelper(boolean includePKs)
Returns all attributes ordered within this instance's hierarchy
|
List<AttributeObject> |
getAttributeValues()
Returns the attributes.
|
List<MethodObject> |
getBusinessMethods()
Returns the businessMethods field.
|
List<ClassObject> |
getChildren()
Returns all the children in the hierarchy with this instance as the root
node.
|
List<String> |
getClassNamesInHierarchy()
Returns only the names of the ClassObjects in this hierarchy.
|
ContainerObject |
getContainmentContext()
Returns the context this instance is contained within.
|
List<AttributeObject> |
getDirectAttributes(boolean includePKs)
Returns the direct attributes
|
List<AttributeObject> |
getEnumerators()
Returns the enumerators as a List of AttributeObjects.
|
List<MethodObject> |
getFindAllByMethods()
Return all methods designated as findAllBy
|
AttributeObject |
getFirstPrimaryKey()
Returns the 1st primary attribute
|
List<AssociationEndObject> |
getMultipleAssociations()
Returns all multiple associations
|
List<AttributeObject> |
getPrimaryKeyAttributes()
Returns all attributes designated as primary keys.
|
List<AttributeObject> |
getRequiredDirectAttributes(boolean includePKs)
Returns the required direct attributes
|
List<AssociationEndObject> |
getSingleAssociations()
Returns all single associations
|
List<AssociationEndObject> |
getSingleAssociations(boolean bIncludeComposites)
Returns all single associations
|
List<AssociationEndObject> |
getSingleAssociationsWithoutSourceRole()
Returns all single associations without a source role
|
List<AssociationEndObject> |
getSingleAssociationsWithSourceRole()
Returns all single associations with a source role
|
List<AttributeObject> |
getUserIdentifiableAttributes()
Get user identifiable attributes
|
String |
getUserIdentifiableNames()
Returns a single String of the user identifiable attribute names each
separated by a space
|
List<AttributeObject> |
getUserModifiableAttributes()
Returns the attributes designated as UserModifiable.
|
List<AttributeObject> |
getUserViewableAttributes()
Returns the attributes designated as UserViewable.
|
boolean |
hasAttributes()
Has attributes indicator
|
boolean |
hasChildren()
Returns true/false if children exist
|
boolean |
hasCompoundPrimaryKey()
Determines if the instance has a compound primary key.
|
boolean |
hasForcedIdentity()
Returns the hasForcedIdentity field.
|
void |
hasForcedIdentity(boolean b)
Assigns the hasForcedIdentity field from the provided attribute.
|
boolean |
hasIdentity()
Determines if the instance has identity.
|
boolean |
hasSimplePrimaryKey()
Determines if the instance has a single primary key.
|
boolean |
hasUIListableMultiAssociation()
Returns true false depending on containing a multiple association that is
designated as UI listable
|
boolean |
isEmpty()
By default return true/false based on getAllInHierarchy.
|
boolean |
isEnumerator()
Returns true or false if this instance is an Enumerator
|
void |
isEnumerator(boolean b)
Is enumerator indicator
|
boolean |
isInterface()
Returns the isInterface field.
|
void |
isInterface(boolean b)
Assigns the isInterface field using the provided argument.
|
boolean |
isService()
Is service indicator
return is service indicator
|
boolean |
methodIsUnique(MethodObject method)
Test the method is unique among the already contained methods
|
void |
modifyPrimaryKeysTo(String transformToType)
Modify primary keys to the provided type
|
void |
reCategorizePrimaryKeyAttributes()
Turns all primary key into a non-primary key attribute by setting its
isPrimaryKey(boolean) flag into false
|
void |
removeAssociation(AssociationEndObject association)
Remove association
|
void |
removeAttribute(AttributeObject attribute)
Remove attribute
|
void |
removeMethod(MethodObject method)
Remove the MethodObject
|
void |
setAssociations(List<AssociationEndObject> associations) |
void |
setAttributes(List<AttributeObject> attributes)
Assigns the attributes field with the provided argument.
|
void |
setBusinessMethods(List<MethodObject> methods)
Assigns the businessMethods field from the provided argument.
|
void |
setContainmentContext(ContainerObject context)
Assigns the context this instance is contained within.
|
void |
sortAttributes()
Sort the attributes in alphabetical order by name
|
AttributeObject |
transformAssociationToAttribute(AssociationEndObject associationEndObject)
Transform a provided association to an attribute
|
canBeGenerated, canBeGenerated, canBeVersioned, canBeVersioned, copy, getDisplayName, getDocumentation, getFormattedPackageName, getInterfaces, getInterfacesAsString, getModelSource, getName, getNamesInHierarchy, getPackageName, getParent, getParentName, getStereotype, getSuperTypes, hasAsParent, hasDocumentation, hasParent, isAbstract, isAbstract, isAuditable, isFromXMLFile, isLeafObject, isNotEmpty, isRootObject, isService, isUserCreateable, isUserCreateable, isUserDefined, isUserDefined, isUserDeletable, isUserDeletable, isUserEditable, isUserEditable, noDuplicates, noDuplicates, reconcileSuperTypes, setDisplayName, setDocumentation, setInterfaces, setModelSource, setName, setPackageName, setParentName, setStereotype, setSuperTypes
getTags, log, logDebugMessage, logError, logErrorMessage, logInfoMessage, logMessage, logWarnMessage, setTags
protected boolean isInterface
protected boolean hasForcedIdentity
protected List<AssociationEndObject> associations
protected List<MethodObject> businessMethods
protected List<AttributeObject> attributes
protected ClassObjectData data
protected ClassObjectAction action
protected ContainerObject containmentContext
public ClassObject()
public ClassObject(ClassObject classObject)
classObject
- source to copy frompublic String getAttributesAsString(boolean bIncludePrimaryKeys, boolean bIncludeTypes, boolean bIncludeAssociations, String delim, String suffix)
bIncludePrimaryKeys
- include primary keys indicatorbIncludeTypes
- include types indicatorbIncludeAssociations
- include associationsdelim
- delimiter to use between each attributesuffix
- suffix to apply to each attributepublic List<AttributeObject> getAttributesOnly(boolean includeHierarchy, boolean includePKs)
includeHierarchy
- include parsing the hierarchy for attributesincludePKs
- include primary keys indicatorpublic AttributeObject findAttributeAsBestFitName()
public List<AttributeObject> getAttributes()
public void setAttributes(List<AttributeObject> attributes)
attributes
- List of AttributeObjectspublic List<AttributeObject> getAttributes(boolean includePrimaryKeys)
includePrimaryKeys
- include primary key indicatorpublic List<AttributeObject> getAttributeValues()
public List<AssociationEndObject> getAssociations()
public void setAssociations(List<AssociationEndObject> associations)
public List<AggregateAttributeObject> getAggregateAttributes()
getAggregateAttributes
in interface IClassObjectData
public List<AttributeObject> getEnumerators()
getEnumerators
in interface IClassObjectData
public List<List> getAggregateAttributesAsAttributes()
public AssociationEndObject getAssociation(String roleName)
roleName
- locate by role namepublic List<MethodObject> getBusinessMethods()
public void setBusinessMethods(List<MethodObject> methods)
methods
- List of MethodObjectspublic List<MethodObject> getFindAllByMethods()
public List<ClassObject> getChildren()
public boolean hasChildren()
public List<String> getClassNamesInHierarchy()
getClassNamesInHierarchy
in interface IClassObjectData
public List<AttributeObject> getUserModifiableAttributes()
getUserModifiableAttributes
in interface IClassObjectData
public List<AttributeObject> getUserViewableAttributes()
getUserViewableAttributes
in interface IClassObjectData
public List<AttributeObject> getAttributesOrdered(boolean includePKs)
getAttributesOrdered
in interface IClassObjectData
includePKs
- include primary key indicatorpublic List<AttributeObject> getRequiredDirectAttributes(boolean includePKs)
getRequiredDirectAttributes
in interface IClassObjectData
includePKs
- include primary key indicatorpublic List<AttributeObject> getDirectAttributes(boolean includePKs)
getDirectAttributes
in interface IClassObjectData
includePKs
- include primary key indicatorpublic List<AttributeObject> getAttributesOrderedInHierarchy()
getAttributesOrderedInHierarchy
in interface IClassObjectData
public List<AttributeObject> getAttributesOrderedInHierarchy(boolean includePKs)
getAttributesOrderedInHierarchy
in interface IClassObjectData
includePKs
- include primary key indicatorpublic List<List> getAttributesOrderedAsCollectionsInHierarchy(boolean includePKs)
getAttributesOrderedAsCollectionsInHierarchy
in interface IClassObjectData
includePKs
- include primary key indicatorpublic List<AttributeObject> getAttributesOrderedInHierarchyHelper(boolean includePKs)
getAttributesOrderedInHierarchyHelper
in interface IClassObjectData
includePKs
- include primary key indicatorpublic AttributeObject getFirstPrimaryKey()
getFirstPrimaryKey
in interface IClassObjectData
public List<AttributeObject> getAllPrimaryKeysInHierarchy()
getAllPrimaryKeysInHierarchy
in interface IClassObjectData
public List<AttributeObject> getAllComposites()
getAllComposites
in interface IClassObjectData
public List<AttributeObject> getAllKeyFieldsInHierchy(List<AttributeObject> coll)
getAllKeyFieldsInHierchy
in interface IClassObjectData
public List<AssociationEndObject> getSingleAssociationsWithoutSourceRole()
getSingleAssociationsWithoutSourceRole
in interface IClassObjectData
public List<AssociationEndObject> getSingleAssociationsWithSourceRole()
getSingleAssociationsWithSourceRole
in interface IClassObjectData
public List<AssociationEndObject> getSingleAssociations()
getSingleAssociations
in interface IClassObjectData
public List<AssociationEndObject> getSingleAssociations(boolean bIncludeComposites)
getSingleAssociations
in interface IClassObjectData
bIncludeComposites
- include composites indicatorpublic List<AssociationEndObject> getMultipleAssociations()
getMultipleAssociations
in interface IClassObjectData
public boolean hasUIListableMultiAssociation()
hasUIListableMultiAssociation
in interface IClassObjectData
public boolean hasAttributes()
hasAttributes
in interface IClassObjectData
public void applySelfToAssociations()
applySelfToAssociations
in interface IClassObjectAction
public void sortAttributes()
sortAttributes
in interface IClassObjectAction
public void addMethod(MethodObject method)
addMethod
in interface IClassObjectAction
method
- MethodObject to addpublic void removeMethod(MethodObject method)
method
- MethodObject to removepublic boolean methodIsUnique(MethodObject method)
methodIsUnique
in interface IClassObjectAction
method
- comparison methodpublic void addAttribute(AttributeObject attribute)
addAttribute
in interface IClassObjectAction
attribute
- attribute to addpublic void removeAttribute(AttributeObject attribute)
removeAttribute
in interface IClassObjectAction
attribute
- attribute to removepublic void addAssociation(AssociationEndObject association)
addAssociation
in interface IClassObjectAction
association
- association to addpublic void removeAssociation(AssociationEndObject association)
removeAssociation
in interface IClassObjectAction
association
- association to removepublic void modifyPrimaryKeysTo(String transformToType)
modifyPrimaryKeysTo
in interface IClassObjectAction
transformToType
- type to transform the primary keys topublic AttributeObject transformAssociationToAttribute(AssociationEndObject associationEndObject)
transformAssociationToAttribute
in interface IClassObjectAction
associationEndObject
- target to transformpublic List<AttributeObject> getUserIdentifiableAttributes()
getUserIdentifiableAttributes
in interface IClassObjectData
public String getUserIdentifiableNames()
getUserIdentifiableNames
in interface IClassObjectData
public List<String> getAssociationTypes(String excludeType)
excludeType
- type to exclude from the return listpublic List<String> getAssociationTypes()
public List<AttributeObject> getPrimaryKeyAttributes()
getPrimaryKeyAttributes
in interface IClassObjectData
protected List<? extends BaseModelObject> getAllOfLikeType()
getAllOfLikeType
in class BaseModelObject
public boolean hasIdentity()
BaseModelObject
hasIdentity
in interface IBaseModelObjectData
hasIdentity
in class BaseModelObject
public boolean hasForcedIdentity()
public void hasForcedIdentity(boolean b)
b
- has forced identity indicatorpublic boolean hasSimplePrimaryKey()
BaseModelObject
hasSimplePrimaryKey
in interface IBaseModelObjectData
hasSimplePrimaryKey
in class BaseModelObject
public boolean hasCompoundPrimaryKey()
BaseModelObject
hasCompoundPrimaryKey
in interface IBaseModelObjectData
hasCompoundPrimaryKey
in class BaseModelObject
public boolean isInterface()
public void isInterface(boolean b)
b
- has interface indicatorpublic boolean isEnumerator()
isEnumerator
in interface IBaseModelObjectData
isEnumerator
in class BaseModelObject
public void isEnumerator(boolean b)
isEnumerator
in interface IBaseModelObjectData
isEnumerator
in class BaseModelObject
b
- is enumerator indicatorpublic boolean isService()
isService
in interface IBaseModelObjectData
isService
in class BaseModelObject
public void reCategorizePrimaryKeyAttributes()
public void copy(ClassObject c)
c
- source to copy frompublic List<BaseModelObject> getAllInHierarchy()
getAllInHierarchy
in class BaseModelObject
public List<ClassObject> getAllClassesInHierarchy()
getAllClassesInHierarchy
in class BaseModelObject
public boolean isEmpty()
BaseModelObject
isEmpty
in class BaseModelObject
public AttributeObject findAttribute(String attributeName)
findAttribute
in interface IClassObjectAction
attributeName
- attribute name to findpublic void finishLoading()
finishLoading
in interface IBaseModelObjectAction
public static ClassObject addAssociationsHelper(ClassObject classObject, List<AssociationEndObject> associations)
classObject
- classObject to add associations toassociations
- associations to addpublic ContainerObject getContainmentContext()
public void setContainmentContext(ContainerObject context)
context
- The container which contains this instanceCopyright © 2021. All rights reserved.