org.jboss.portal.core.impl.model.portal
Class PortalObjectImpl

java.lang.Object
  extended by org.jboss.portal.core.impl.model.portal.PortalObjectImpl
All Implemented Interfaces:
java.lang.Comparable, PortalObject
Direct Known Subclasses:
ContextImpl, PageImpl, PortalImpl, WindowImpl

public abstract class PortalObjectImpl
extends java.lang.Object
implements PortalObject

Version:
$Revision: 9158 $
Author:
Julien Viet

Field Summary
protected static int ALL_TYPES_MASK
          .
protected static org.apache.log4j.Logger log
          The logger.
 
Fields inherited from interface org.jboss.portal.core.model.portal.PortalObject
CONTEXT_MASK, DEFAULT_OBJECT_NAME, PAGE_MASK, PORTAL_MASK, PORTAL_PROP_DEFAULT_OBJECT_NAME, TYPE_CONTEXT, TYPE_PAGE, TYPE_PORTAL, TYPE_WINDOW, WINDOW_MASK
 
Constructor Summary
PortalObjectImpl()
           
PortalObjectImpl(boolean initState)
           
 
Method Summary
protected  void addChild(java.lang.String name, PortalObjectImpl childObject)
           
protected abstract  PortalObjectImpl cloneObject()
           
 int compareTo(java.lang.Object o)
           
 PortalObject copy(PortalObject parent, java.lang.String name, boolean deep)
          Copy the portal object as a child of the specified object.
protected  void destroy()
          Overridable callback.
 void destroyChild(java.lang.String name)
          Destroy an existing child.
 boolean equals(java.lang.Object obj)
           
 PortalObject getChild(java.lang.String name)
          Return a specific child object or null if it does not exist.
 java.util.Collection getChildren()
          Return all the children of this object.
 java.util.Collection getChildren(int wantedMask)
          Return all the children of this object filtered with a particular mask.
 java.util.Map getDeclaredProperties()
          Return a map that contains the object declared properties.
 java.lang.String getDeclaredProperty(java.lang.String name)
          Return a property declared on that object.
 java.util.Map getDeclaredPropertyMap()
           
protected  PortalObject getDefaultChild()
          Return the default child of this object based on the declared property that specifies the default object name.
 LocalizedString getDisplayName()
          Return the localized string used to represent that object.
 java.util.Map getDisplayNames()
           
 PortalObjectId getId()
          Return the object id unique in the scope of its container.
 java.lang.Long getKey()
           
 java.lang.String getListener()
          Returns the listener id or null if there is none.
protected  int getMask()
           
protected  int getMask(int portalObjectType)
          Returns the mask for this kind of object.
 java.lang.String getName()
          Return the object name unique in the scope of its parent.
 ObjectNode getObjectNode()
           
 PortalObject getParent()
          Return the parent object.
 java.util.Map getProperties()
          Get the aggregated properties in a lazy manner.
 java.lang.String getProperty(java.lang.String name)
          Return a property of that object.
abstract  int getType()
          Returns the type of the object which is a value that discriminates the object type.
 int hashCode()
           
 void setDeclaredProperty(java.lang.String name, java.lang.String value)
          Update a property declared on that object.
 void setDeclaredPropertyMap(java.util.Map properties)
           
 void setDisplayName(LocalizedString displayName)
          Set the localized string used to represent that object.
 void setDisplayNames(java.util.Map displayNames)
           
 void setKey(java.lang.Long key)
           
 void setListener(java.lang.String listener)
          Set a listener id.
 void setObjectNode(ObjectNode objectNode)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
The logger.


ALL_TYPES_MASK

protected static final int ALL_TYPES_MASK
.

See Also:
Constant Field Values
Constructor Detail

PortalObjectImpl

public PortalObjectImpl()

PortalObjectImpl

public PortalObjectImpl(boolean initState)
Method Detail

getKey

public java.lang.Long getKey()

setKey

public void setKey(java.lang.Long key)

getObjectNode

public ObjectNode getObjectNode()

setObjectNode

public void setObjectNode(ObjectNode objectNode)

getId

public PortalObjectId getId()
Description copied from interface: PortalObject
Return the object id unique in the scope of its container.

Specified by:
getId in interface PortalObject
Returns:
the object id

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

destroyChild

public void destroyChild(java.lang.String name)
                  throws NoSuchPortalObjectException
Description copied from interface: PortalObject
Destroy an existing child.

Specified by:
destroyChild in interface PortalObject
Parameters:
name - the child name
Throws:
NoSuchPortalObjectException - if the child does not exist

getName

public java.lang.String getName()
Description copied from interface: PortalObject
Return the object name unique in the scope of its parent.

Specified by:
getName in interface PortalObject
Returns:
the object name

setDisplayNames

public void setDisplayNames(java.util.Map displayNames)

getDisplayNames

public java.util.Map getDisplayNames()

setDisplayName

public void setDisplayName(LocalizedString displayName)
Description copied from interface: PortalObject
Set the localized string used to represent that object.

Specified by:
setDisplayName in interface PortalObject

getDisplayName

public LocalizedString getDisplayName()
Description copied from interface: PortalObject
Return the localized string used to represent that object.

Specified by:
getDisplayName in interface PortalObject
Returns:
the localized display name

copy

public PortalObject copy(PortalObject parent,
                         java.lang.String name,
                         boolean deep)
                  throws DuplicatePortalObjectException,
                         java.lang.IllegalArgumentException
Description copied from interface: PortalObject
Copy the portal object as a child of the specified object.

Specified by:
copy in interface PortalObject
Parameters:
parent - the parent of the copy
name - the name of the child
deep - true copies recursively children
Returns:
the newly created node child of the specified parent
Throws:
DuplicatePortalObjectException - if the specified parent has already a node with such a name
java.lang.IllegalArgumentException - if the specified parent is null

getChildren

public java.util.Collection getChildren()
Description copied from interface: PortalObject
Return all the children of this object.

Specified by:
getChildren in interface PortalObject
Returns:
the children

getChildren

public java.util.Collection getChildren(int wantedMask)
Description copied from interface: PortalObject
Return all the children of this object filtered with a particular mask.

Specified by:
getChildren in interface PortalObject
Returns:
the children

getListener

public java.lang.String getListener()
Description copied from interface: PortalObject
Returns the listener id or null if there is none.

Specified by:
getListener in interface PortalObject
Returns:
the listener

setListener

public void setListener(java.lang.String listener)
Description copied from interface: PortalObject
Set a listener id.

Specified by:
setListener in interface PortalObject
Parameters:
listener - the listener id

getParent

public PortalObject getParent()
Description copied from interface: PortalObject
Return the parent object.

Specified by:
getParent in interface PortalObject
Returns:
the parent object.

getChild

public PortalObject getChild(java.lang.String name)
Description copied from interface: PortalObject
Return a specific child object or null if it does not exist.

Specified by:
getChild in interface PortalObject
Returns:
a child object.

getProperties

public java.util.Map getProperties()
Get the aggregated properties in a lazy manner.

Specified by:
getProperties in interface PortalObject
Returns:
a map of the object properties

getDeclaredPropertyMap

public java.util.Map getDeclaredPropertyMap()

setDeclaredPropertyMap

public void setDeclaredPropertyMap(java.util.Map properties)

getDeclaredProperties

public java.util.Map getDeclaredProperties()
Description copied from interface: PortalObject
Return a map that contains the object declared properties.

Specified by:
getDeclaredProperties in interface PortalObject
Returns:
a map of the properties declared by the object

getDeclaredProperty

public java.lang.String getDeclaredProperty(java.lang.String name)
Description copied from interface: PortalObject
Return a property declared on that object.

Specified by:
getDeclaredProperty in interface PortalObject
Returns:
the property value

setDeclaredProperty

public void setDeclaredProperty(java.lang.String name,
                                java.lang.String value)
Description copied from interface: PortalObject
Update a property declared on that object.

Specified by:
setDeclaredProperty in interface PortalObject
Parameters:
name - the property name
value - the property value

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: PortalObject
Return a property of that object.

Specified by:
getProperty in interface PortalObject
Returns:
the property value

getType

public abstract int getType()
Description copied from interface: PortalObject
Returns the type of the object which is a value that discriminates the object type.

Specified by:
getType in interface PortalObject
Returns:
the object type.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getDefaultChild

protected PortalObject getDefaultChild()
Return the default child of this object based on the declared property that specifies the default object name.


cloneObject

protected abstract PortalObjectImpl cloneObject()

destroy

protected void destroy()
Overridable callback.


getMask

protected final int getMask()

getMask

protected final int getMask(int portalObjectType)
Returns the mask for this kind of object.


addChild

protected final void addChild(java.lang.String name,
                              PortalObjectImpl childObject)
                       throws DuplicatePortalObjectException,
                              java.lang.IllegalArgumentException
Throws:
DuplicatePortalObjectException
java.lang.IllegalArgumentException