org.apache.jetspeed.om.registry.base
Class BasePortletInfoEntry

java.lang.Object
  extended byorg.apache.jetspeed.om.registry.base.BaseRegistryEntry
      extended byorg.apache.jetspeed.om.registry.base.BasePortletInfoEntry
All Implemented Interfaces:
RegistryEntry, java.io.Serializable
Direct Known Subclasses:
BasePortletControlEntry, BasePortletControllerEntry, BasePortletEntry

public abstract class BasePortletInfoEntry
extends BaseRegistryEntry

The BasePortletInfoEntry is a bean like implementation of the PortletInfoEntry interface suitable for Castor XML serialization

Version:
$Id: BasePortletInfoEntry.java,v 1.10 2005/03/21 18:21:37 sgala Exp $
Author:
Raphaël Luta
See Also:
PortletInfoEntry, Serialized Form

Field Summary
protected  java.lang.String classname
           
protected  java.util.Vector medias
           
protected  java.util.Map mediasIdx
           
protected  java.util.Map nameIdx
           
protected  java.util.Vector parameter
           
protected  java.util.Vector tools
           
protected  java.util.Map toolsIdx
           
 
Fields inherited from class org.apache.jetspeed.om.registry.base.BaseRegistryEntry
_hidden, hidden, id, metaInfo, name, security, securityRef
 
Constructor Summary
BasePortletInfoEntry()
           
 
Method Summary
 void addMediaType(java.lang.String name)
          Add a new supported media type
 void addParameter(Parameter param)
          Adds a new parameter for this entry
 void addParameter(java.lang.String name, java.lang.String value)
          Adds a new parameter for this entry
 void addTool(ToolDescriptor tool)
          Adds a new parameter for this entry
protected  void buildNameIndex()
          This method recreates the paramter name index for quick retrieval of parameters by name.
 boolean equals(java.lang.Object object)
          Implements the equals operation so that 2 elements are equal if all their member values are equal.
 java.lang.String getClassname()
           
 java.util.Vector getMediaTypes()
          Needed for Castor 0.8.11 XML serialization for retrieving the media type names associated to this object
 Parameter getParameter(java.lang.String name)
          Search for a named parameter and return the associated parameter object.
 java.util.Map getParameterMap()
          Returns a map of parameter values keyed on the parameter names
 java.util.Iterator getParameterNames()
           
 java.util.Vector getParameters()
          Needed for Castor 0.8.11 XML serialization for retrieving the parameters objects associated to this object
 ToolDescriptor getTool(java.lang.String name)
          Search for a named parameter and return the associated parameter object.
 java.util.Map getToolMap()
          Returns a map of parameter values keyed on the parameter names
 java.util.Iterator getToolNames()
           
 java.util.Vector getTools()
           
 boolean hasMediaType(java.lang.String name)
          Test if a given media type is supported by this entry.
 java.util.Iterator listMediaTypes()
          Returns a list of the supported media type names
 void removeMediaType(java.lang.String name)
          Remove support for a given media type
 void removeParameter(java.lang.String name)
          Removes all parameter values associated with the name
 void removeTool(java.lang.String name)
          Removes all parameter values associated with the name
 void setClassname(java.lang.String classname)
          Sets the classname for this entry.
 void setMediaTypes(java.util.Vector mediaTypes)
           
 void setParameters(java.util.Vector parameters)
           
 void setTools(java.util.Vector tools)
           
 
Methods inherited from class org.apache.jetspeed.om.registry.base.BaseRegistryEntry
getBaseMetaInfo, getBaseSecurity, getDescription, getHidden, getId, getMetaInfo, getName, getSecurity, getSecurityRef, getTitle, isHidden, setBaseMetaInfo, setBaseSecurity, setDescription, setHidden, setMetaInfo, setName, setSecurity, setSecurityRef, setTitle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classname

protected java.lang.String classname

parameter

protected java.util.Vector parameter

nameIdx

protected transient java.util.Map nameIdx

medias

protected java.util.Vector medias

mediasIdx

protected transient java.util.Map mediasIdx

tools

protected java.util.Vector tools

toolsIdx

protected transient java.util.Map toolsIdx
Constructor Detail

BasePortletInfoEntry

public BasePortletInfoEntry()
Method Detail

equals

public boolean equals(java.lang.Object object)
Implements the equals operation so that 2 elements are equal if all their member values are equal.

Overrides:
equals in class BaseRegistryEntry

getClassname

public java.lang.String getClassname()
Returns:
the classname associated to this entry

setClassname

public void setClassname(java.lang.String classname)
Sets the classname for this entry. This classname is used for instanciating the associated element

Parameters:
classname - the classname used for instanciating the component associated with this entry

getParameterNames

public java.util.Iterator getParameterNames()
Returns:
an enumeration of this entry parameter names

getParameter

public Parameter getParameter(java.lang.String name)
Search for a named parameter and return the associated parameter object. The search is case sensitive.

Parameters:
name - the parameter name to look for
Returns:
the parameter object for a given parameter name

getParameterMap

public java.util.Map getParameterMap()
Returns a map of parameter values keyed on the parameter names

Returns:
the parameter values map

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Adds a new parameter for this entry

Parameters:
name - the new parameter name
value - the new parameter value

addParameter

public void addParameter(Parameter param)
Adds a new parameter for this entry


removeParameter

public void removeParameter(java.lang.String name)
Removes all parameter values associated with the name

Parameters:
name - the parameter name to remove

listMediaTypes

public java.util.Iterator listMediaTypes()
Returns a list of the supported media type names

Returns:
an iterator on the supported media type names

hasMediaType

public boolean hasMediaType(java.lang.String name)
Test if a given media type is supported by this entry. The test is done by a case sensitive name comparison

Parameters:
name - the media type name to test for.
Returns:
true is the media type is supported false otherwise

addMediaType

public void addMediaType(java.lang.String name)
Add a new supported media type

Parameters:
name - the media type name to add.

removeMediaType

public void removeMediaType(java.lang.String name)
Remove support for a given media type

Parameters:
name - the media type name to remove.

getParameters

public java.util.Vector getParameters()
Needed for Castor 0.8.11 XML serialization for retrieving the parameters objects associated to this object


setParameters

public void setParameters(java.util.Vector parameters)

setMediaTypes

public void setMediaTypes(java.util.Vector mediaTypes)

getMediaTypes

public java.util.Vector getMediaTypes()
Needed for Castor 0.8.11 XML serialization for retrieving the media type names associated to this object


getTools

public java.util.Vector getTools()

setTools

public void setTools(java.util.Vector tools)

buildNameIndex

protected void buildNameIndex()
This method recreates the paramter name index for quick retrieval of parameters by name. Shoule be called whenever a complete index of parameter should be rebuilt (eg removing a parameter or setting a parameters vector)


getToolNames

public java.util.Iterator getToolNames()
Returns:
an enumeration of this entry parameter names

getTool

public ToolDescriptor getTool(java.lang.String name)
Search for a named parameter and return the associated parameter object. The search is case sensitive.

Parameters:
name - the parameter name to look for
Returns:
the parameter object for a given parameter name

getToolMap

public java.util.Map getToolMap()
Returns a map of parameter values keyed on the parameter names

Returns:
the parameter values map

addTool

public void addTool(ToolDescriptor tool)
Adds a new parameter for this entry


removeTool

public void removeTool(java.lang.String name)
Removes all parameter values associated with the name

Parameters:
name - the parameter name to remove


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.