public class IlpDefaultClass extends IlpAbstractClass implements IlpMutableClass
IlpClass
represent classes of the model.
They provide access to the class hierarchy, and
to the class attributes.Constructor and Description |
---|
IlpDefaultClass(String name)
Creates an
IlpClass with the given name. |
IlpDefaultClass(String name,
IlpClass superClass,
List<IlpClass> subClasses)
Creates an
IlpClass instance with all the needed
configuration. |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(IlpAttribute attribute)
Adds an attribute to the class.
|
void |
addAttributeGroup(IlpAttributeGroup model)
Adds the given model to be used by this one.
|
void |
addAttributeGroupListener(AttributeGroupListener l)
Adds a listener to model changes.
|
void |
fireEvent(AttributeGroupEvent ev)
Fires an event to the listeners.
|
IlpAttribute |
getAttribute(String name)
Returns an instance attribute of the class.
|
Collection<IlpAttributeGroup> |
getAttributeGroups()
Returns the list of all attribute groups being used by this one.
|
Collection<IlpAttribute> |
getAttributes()
Returns the instance attributes of the class as a
Collection . |
Collection<IlpAttribute> |
getDeclaredAttributes()
Returns the instance attributes of the class as a
Collection . |
boolean |
hasAttribute(IlpAttribute attr)
Returns whether the given attribute is part of the model.
|
IlpObject |
newInstance(IlpClass ilpClass,
Object identifier,
boolean initializeAttributeValues)
Creates an instance of the class.
|
IlpObject |
newInstance(Object identifier,
boolean initializeAttributeValues)
Creates an instance of the class.
|
void |
removeAttribute(IlpAttribute attribute)
Removes an attribute from the class.
|
void |
removeAttributeGroup(IlpAttributeGroup model)
Removes the given model from the list of models.
|
void |
removeAttributeGroupListener(AttributeGroupListener l)
Removes the model listener.
|
void |
setSuperClass(IlpClass superClass)
Sets the superclass.
|
String |
toString()
Converts the object into a human-readable format.
|
addSubClass, getName, getSubClasses, getSuperClass, isAssignableFrom, isSubClassOf, removeSubClass
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addSubClass, removeSubClass
getSubClasses, getSuperClass, isAssignableFrom, isSubClassOf
getName
public IlpDefaultClass(String name)
IlpClass
with the given name.name
- IlpClass
name identifier.public IlpDefaultClass(String name, IlpClass superClass, List<IlpClass> subClasses)
IlpClass
instance with all the needed
configuration.name
- IlpClass
name identifier.superClass
- List of all the IlpClass
instances
that are superclasses of this one.subClasses
- List of all the classes that inherit from
this one.
.public void setSuperClass(IlpClass superClass)
This method sets the superclass information. It does not
update the corresponding information in the parent class. To do this, use
the method addSubClass
.
setSuperClass
in interface IlpMutableClass
superClass
- Super classIlpAbstractClass.addSubClass(ilog.cpl.model.IlpClass)
public void addAttributeGroup(IlpAttributeGroup model)
addAttributeGroup
in interface IlpMutableClass
public void removeAttributeGroup(IlpAttributeGroup model)
removeAttributeGroup
in interface IlpMutableClass
public Collection<IlpAttributeGroup> getAttributeGroups()
addAttributeGroup(ilog.cpl.model.IlpAttributeGroup)
public void addAttribute(IlpAttribute attribute)
addAttribute
in interface IlpMutableAttributeGroup
attribute
- The attribute to be added.IlpAttribute.setAttributeGroup(ilog.cpl.model.IlpAttributeGroup)
public void removeAttribute(IlpAttribute attribute)
removeAttribute
in interface IlpMutableAttributeGroup
attribute
- The attribute to be removed.IlpAttribute.setAttributeGroup(ilog.cpl.model.IlpAttributeGroup)
public IlpObject newInstance(Object identifier, boolean initializeAttributeValues)
The new instance is created with the given identifier. If the
argument initializeAttributeValues
is set, the new instance
is initialized with the default attribute values. Default attribute
values are set in the attribute itself and are retrieved using
IlpAttribute.getDefaultValue()
.
newInstance
in interface IlpClass
identifier
- Object identifier.initializeAttributeValues
- Whether or not the default attribute
values should be initialized.IlpObject
interface. This default
implementation returns an IlpDefaultObject
instance.IlpObject
,
IlpAttribute.getDefaultValue()
public IlpObject newInstance(IlpClass ilpClass, Object identifier, boolean initializeAttributeValues)
The new instance is created with the given identifier. If the
argument initializeAttributeValues
is set, the new instance
is initialized with the default attribute values. Default attribute
values are set in the attribute itself and are retrieved using
IlpAttribute.getDefaultValue()
.
Note: This method is supposed to be called by a subclass, the subclass passing itself as the first parameter.
newInstance
in interface IlpClass
ilpClass
- Business class.identifier
- Object identifier.initializeAttributeValues
- Whether or not the default attribute
values should be initialized.IlpObject
interface. This default implementation
returns an IlpDefaultObject
instance.IlpObject
,
IlpAttribute.getDefaultValue()
public Collection<IlpAttribute> getAttributes()
Collection
.
This implementation returns a collection where the attributes are in the following order:
getAttributes
in interface IlpAttributeGroup
IlpAttribute
instances.public Collection<IlpAttribute> getDeclaredAttributes()
Collection
.
This method returns only the attributes declared in this class in their
insertion order.getDeclaredAttributes
in interface IlpAttributeGroup
IlpAttribute
instances.public IlpAttribute getAttribute(String name)
getAttribute
in interface IlpAttributeGroup
name
- The name of the instance attribute to be retrieved.null
if there is no matching attribute.public boolean hasAttribute(IlpAttribute attr)
hasAttribute
in interface IlpAttributeGroup
public void addAttributeGroupListener(AttributeGroupListener l)
addAttributeGroupListener
in interface IlpAttributeGroup
public void removeAttributeGroupListener(AttributeGroupListener l)
removeAttributeGroupListener
in interface IlpAttributeGroup
public void fireEvent(AttributeGroupEvent ev)
fireEvent
in interface IlpAttributeGroup
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.