|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.p13n.model.Model
public abstract class Model
The base model class for all wlp-schema based model. Models are specifically not thread-safe.
Nested Class Summary | |
---|---|
static class |
Model.ChangeEvent
A model change event. |
static interface |
Model.ChangeListener
The interface to listen to a model's change events. |
static class |
Model.ChangeSupport
Helper class for managing ChangeListeners. |
static class |
Model.Debug
Debug class. |
Field Summary | |
---|---|
protected List<Model> |
childrenModels
Our children models. |
protected DocumentModel |
docModel
Our DocumentModel. |
protected Model |
parentModel
Our parent model. |
protected List<Model> |
roChildrenModels
A read-only list of our children models. |
Constructor Summary | |
---|---|
Model()
Empty constructor. |
|
Model(DocumentModel docModel)
Constructor with a container document model. |
Method Summary | |
---|---|
void |
addChangeListener(Model.ChangeListener cl)
Add a change listener to this model instance. |
protected void |
addChild(Model child)
Add a child to this model. |
protected void |
addChild(Model child,
int pos)
Add a child to this model. |
protected boolean |
childAdded(Model child)
Handle the post-processing of a child being added. |
protected boolean |
childRemoved(Model child)
Handle the post-processing of a child being removed. |
Object |
clone()
Make clone of this object initialize with the same data, but unassociated to the original. |
abstract Model |
copy()
Make a new Model of the same type as this, initialized with the same underlying data, but otherwise unassociated to this one. |
static boolean |
doubleEquals(Number o1,
Number o2)
A null-aware equals() method against doubleValue(). |
static boolean |
equals(Object o1,
Object o2)
A null-aware equals() method. |
List<Model> |
getChildren()
Get a read-only list of our children models. |
static Model.Debug |
getDebug(Class cl)
Get the Debug object for the specified class. |
static Model.Debug |
getDebug(String name)
Get the Debug object for the specified name. |
DocumentModel |
getDocument()
Get our DocumentModel (null if none set). |
Model |
getParent()
Get our parent model, null if this is a root or was removed from its parent. |
static boolean |
longEquals(Number o1,
Number o2)
A null-aware equals() method against longValue(). |
void |
preRemove()
Called just prior to this model being removed from its parent. |
protected boolean |
propertyChanged(String propName,
Object oldVal,
Object newVal)
Handle the post-processing of a property change. |
boolean |
removeChangeListener(Model.ChangeListener cl)
Remove a change listener from this model instance. |
protected Model |
removeChild(int index)
Remove a child from this model by index. |
protected boolean |
removeChild(Model child)
Remove a child from this model. |
static String[] |
removeEmpties(String[] strs)
Remove null or empty strings from the array. |
void |
setDocument(DocumentModel docModel)
Set our DocumentModel (null for none). |
protected void |
setParent(Model parent)
Set our parent model (null if this is a root or was removed from its parent). |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DocumentModel docModel
protected List<Model> childrenModels
protected transient List<Model> roChildrenModels
protected Model parentModel
Constructor Detail |
---|
public Model(DocumentModel docModel)
public Model()
Method Detail |
---|
public Object clone()
clone
in class Object
public abstract Model copy()
public DocumentModel getDocument()
public void setDocument(DocumentModel docModel)
public Model getParent()
protected void setParent(Model parent)
public void preRemove()
setParent(null)
will be called after the model has
been removed. Subclasses can override this to help deal with being
removed from their parent.
Models that have children should call this method prior to unhooking any underlying datastore; this will allow the child model to know they are being removed and to prepare themselves appropriately.
public List<Model> getChildren()
protected void addChild(Model child, int pos)
child
- the child model to add.pos
- the position to add child at, -1 for the end.protected void addChild(Model child)
child
- the child model to add.protected boolean removeChild(Model child)
child
- the child model to remove.
protected Model removeChild(int index)
index
- the child model to remove.
public void addChangeListener(Model.ChangeListener cl)
public boolean removeChangeListener(Model.ChangeListener cl)
protected boolean propertyChanged(String propName, Object oldVal, Object newVal)
propName
- the property name.oldVal
- the previous value (null is valid).newVal
- the new value (null is valid).
protected boolean childAdded(Model child)
child
- the child that was added.
protected boolean childRemoved(Model child)
child
- the child that was removed.
public static boolean equals(Object o1, Object o2)
public static boolean longEquals(Number o1, Number o2)
public static boolean doubleEquals(Number o1, Number o2)
public static String[] removeEmpties(String[] strs)
public static Model.Debug getDebug(Class cl)
getDebug(java.lang.String)
public static Model.Debug getDebug(String name)
Debug
, except it
doesn't obey the out.file and reloadable flags. So, output always go to
System.err and this won't reload debug.properties if it changes.
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |