pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.accesscontrol.attributes
Class SectionAttribute

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.Node
          extended by org.torweg.pulse.accesscontrol.attributes.AbstractAttribute<NilType>
              extended by org.torweg.pulse.accesscontrol.attributes.SectionAttribute
All Implemented Interfaces:
java.io.Serializable, JDOMable, INameable, INamed

@Entity
public class SectionAttribute
extends AbstractAttribute<NilType>
implements INameable

a very simple Attribute for structuring the AttributeRegistry.

Version:
$Revision: 1809 $
Author:
Thomas Weber, Daniel Dietz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.torweg.pulse.accesscontrol.attributes.AbstractAttribute
LOGGER
 
Constructor Summary
SectionAttribute()
          creates a new SectionAttribute, which is not a system attribute.
SectionAttribute(boolean isSystem)
          creates a new SectionAttribute.
SectionAttribute(java.lang.String n)
          creates a new SectionAttribute with the given name.
SectionAttribute(java.lang.String n, boolean isSystem)
          creates a new SectionAttribute with the given name.
 
Method Summary
 org.jdom.Element deserializeToJDOM()
          returns a JDOM representation of the attribute.
 org.jdom.Element deserializeToJDOM(java.util.Map<java.lang.Long,AbstractValue<?>> valueMap)
          returns a JDOM representation of the attribute.
 AbstractAttribute<NilType> getAttributeInstance(java.lang.String n, boolean isSystem)
          returns a new instance of this attribute-class.
 AbstractTypedCheck<NilType> getCheck()
          returns the check.
 java.lang.String getName()
          returns the attributes name.
 void setCheck(AbstractTypedCheck<NilType> c)
          sets the check.
 void setName(java.lang.String n)
          sets the name of the attribute.
 net.sf.json.JSONObject toJSON()
          returns a JSONObject representation of the Node .
 AbstractAttribute<NilType> updateSettingsFromCommand(Command command, org.hibernate.Session session)
          does nothing since SectionAttributes do not have any settings.
 AbstractValue<NilType> valueFromCommand(Command c)
          returns null as SectionAttributes do not have values.
 
Methods inherited from class org.torweg.pulse.accesscontrol.attributes.AbstractAttribute
addAdminEditRole, addAdminViewRole, addSelfEditRole, addSelfViewRole, addTriggeredRole, getAdminEditRoles, getAdminViewRoles, getSelfEditRoles, getSelfViewRoles, getTriggeredRoles, getTypedChecks, getValue, isRequired, isSystemAttribute, isValid, removeAdminEditRole, removeAdminViewRole, removeSelfEditRole, removeSelfViewRole, removeTriggeredRole, setAdminEditRoles, setAdminViewRoles, setRequired, setSelfEditRoles, setSelfViewRoles, setTriggeredRoles, setValue
 
Methods inherited from class org.torweg.pulse.util.entity.Node
addChild, addChild, getChild, getChildIndex, getChildren, getParent, hasChildren, removeChild, setChildren
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectionAttribute

public SectionAttribute()
creates a new SectionAttribute, which is not a system attribute.


SectionAttribute

public SectionAttribute(boolean isSystem)
creates a new SectionAttribute.

Parameters:
isSystem - flag, indicating whether the attribute is a system attribute

SectionAttribute

public SectionAttribute(java.lang.String n)
creates a new SectionAttribute with the given name.

Parameters:
n - the name

SectionAttribute

public SectionAttribute(java.lang.String n,
                        boolean isSystem)
creates a new SectionAttribute with the given name.

Parameters:
n - the name
isSystem - flag, indicating whether the attribute is a system attribute
Method Detail

setName

public final void setName(java.lang.String n)
sets the name of the attribute.

Specified by:
setName in interface INameable
Parameters:
n - the name to set
See Also:
INameable.setName(String)

getName

public final java.lang.String getName()
returns the attributes name.

Specified by:
getName in interface INamed
Specified by:
getName in class AbstractAttribute<NilType>
Returns:
the name

getCheck

public final AbstractTypedCheck<NilType> getCheck()
returns the check.

Specified by:
getCheck in class AbstractAttribute<NilType>
Returns:
the check
See Also:
AbstractAttribute.getCheck()

setCheck

public final void setCheck(AbstractTypedCheck<NilType> c)
sets the check.

Specified by:
setCheck in class AbstractAttribute<NilType>
Parameters:
c - the check to set
See Also:
AbstractAttribute.setCheck(org.torweg.pulse.accesscontrol.attributes.AbstractTypedCheck)

getAttributeInstance

public final AbstractAttribute<NilType> getAttributeInstance(java.lang.String n,
                                                             boolean isSystem)
returns a new instance of this attribute-class.

Specified by:
getAttributeInstance in class AbstractAttribute<NilType>
Parameters:
n - the name of the new attribute
isSystem - indicates if new attribute is system-attribute
Returns:
a new instance of this attribute-class

valueFromCommand

public final AbstractValue<NilType> valueFromCommand(Command c)
returns null as SectionAttributes do not have values.

Specified by:
valueFromCommand in class AbstractAttribute<NilType>
Parameters:
c - the command
Returns:
null

updateSettingsFromCommand

public final AbstractAttribute<NilType> updateSettingsFromCommand(Command command,
                                                                  org.hibernate.Session session)
does nothing since SectionAttributes do not have any settings.

Specified by:
updateSettingsFromCommand in class AbstractAttribute<NilType>
Parameters:
command - is ignored
session - is not used
Returns:
the current instance
See Also:
AbstractAttribute.updateSettingsFromCommand(Command, Session)

toJSON

public final net.sf.json.JSONObject toJSON()
returns a JSONObject representation of the Node .

Overrides:
toJSON in class AbstractAttribute<NilType>
Returns:
a JSONObject representation of the Node

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
returns a JDOM representation of the attribute.

Specified by:
deserializeToJDOM in interface JDOMable
Overrides:
deserializeToJDOM in class AbstractAttribute<NilType>
Returns:
a JDOM representation of the attribute
See Also:
AbstractAttribute.deserializeToJDOM()

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM(java.util.Map<java.lang.Long,AbstractValue<?>> valueMap)
returns a JDOM representation of the attribute.

used during deserialization of a User

Overrides:
deserializeToJDOM in class AbstractAttribute<NilType>
Parameters:
valueMap - maps attribute-ids a Users attribute-values
Returns:
a JDOM representation of the attribute
See Also:
AbstractAttribute.deserializeToJDOM()