SAP NetWeaver '04

com.sapportals.wcm.repository
Class Property

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.framework_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.WcmObject
        |
        +--com.sapportals.wcm.repository.Property
All Implemented Interfaces:
IProperty, java.io.Serializable
Direct Known Subclasses:
MutableProperty

public class Property
extends WcmObject
implements IProperty, java.io.Serializable

A read-only property of a resource object.

Copyright (c) SAP AG 2001-2004

See Also:
Serialized Form

Field Summary
protected  java.util.Properties m_attributes
          The collection of property attributes
protected  java.util.Date m_dateValue
          The value if the type is Date
protected  ResourceBundles m_res
           
protected  java.lang.String m_value
          The value
protected  java.lang.Object m_value_object
           
protected  java.util.List m_values
          Values of multivalued property
 
Fields inherited from class com.sapportals.wcm.WcmObject
ORDER_TYPE_MANUAL, ORDER_TYPE_NONE
 
Constructor Summary
  Property(IPropertyName name, java.lang.Boolean value)
          Construct a new property of type BOOLEAN.
  Property(IPropertyName name, java.lang.Boolean value, java.util.Properties attributes)
          Construct a new property of type BOOLEAN.
  Property(IPropertyName name, java.util.Date value)
          Construct a new property of type DATE.
  Property(IPropertyName name, java.util.Date value, java.util.Properties attributes)
          Construct a new property of type DATE.
  Property(IPropertyName name, java.lang.Integer value)
          Construct a new property of type INTEGER.
  Property(IPropertyName name, java.lang.Integer value, java.util.Properties attributes)
          Construct a new property of type INTEGER.
protected Property(IPropertyName name, IPropertyDef def)
           
  Property(IPropertyName name, IPropertyDef def, java.lang.Boolean value)
          Construct a new property of type BOOLEAN.
  Property(IPropertyName name, IPropertyDef def, java.lang.Boolean value, java.util.Properties attributes)
          Construct a new property of type BOOLEAN.
  Property(IPropertyName name, IPropertyDef def, java.util.Date value)
          Construct a new property of type DATE.
  Property(IPropertyName name, IPropertyDef def, java.util.Date value, java.util.Properties attributes)
          Construct a new property of type DATE.
  Property(IPropertyName name, IPropertyDef def, java.lang.Integer value)
          Construct a new property of type INTEGER.
  Property(IPropertyName name, IPropertyDef def, java.lang.Integer value, java.util.Properties attributes)
          Construct a new property of type INTEGER.
  Property(IPropertyName name, IPropertyDef def, java.util.List values)
          Construct a new multi-valued property.
  Property(IPropertyName name, IPropertyDef def, java.util.List values, java.util.Properties attributes)
          Construct a new multi-valued property.
  Property(IPropertyName name, IPropertyDef def, java.lang.Long value)
          Construct a new property of type LONG.
  Property(IPropertyName name, IPropertyDef def, java.lang.Long value, java.util.Properties attributes)
          Construct a new property of type LONG.
  Property(IPropertyName name, IPropertyDef def, java.lang.Object value)
          Construct a new property.
  Property(IPropertyName name, IPropertyDef def, java.lang.Object value, java.util.Properties attributes)
          Construct a new property.
  Property(IPropertyName name, IPropertyDef def, java.lang.String value)
          Construct a new property of type STRING.
  Property(IPropertyName name, IPropertyDef def, java.lang.String value, java.util.Properties attributes)
          Construct a new property of type STRING.
  Property(IPropertyName name, IPropertyDef def, XMLMarkup value)
          Construct a new property of type XML.
  Property(IPropertyName name, IPropertyDef def, XMLMarkup value, java.util.Properties attributes)
          Construct a new property of type XML.
  Property(IPropertyName name, java.lang.Long value)
          Construct a new property of type LONG.
  Property(IPropertyName name, java.lang.Long value, java.util.Properties attributes)
          Construct a new property of type LONG.
  Property(IPropertyName name, java.lang.Object value)
          Construct a new property.
  Property(IPropertyName name, java.lang.Object value, java.util.Properties attributes)
          Construct a new property.
protected Property(IPropertyName name, PropertyType type, boolean isMultivalued)
           
  Property(IPropertyName name, PropertyType type, java.util.List values)
          Construct a new multi-valued property.
  Property(IPropertyName name, PropertyType type, java.util.List values, java.util.Properties attributes)
          Construct a new multi-valued property.
  Property(IPropertyName name, java.lang.String value)
          Construct a new property of type STRING.
  Property(IPropertyName name, java.lang.String value, java.util.Properties attributes)
          Construct a new property of type STRING.
  Property(IPropertyName name, XMLMarkup value)
          Construct a new property of type XML.
  Property(IPropertyName name, XMLMarkup value, java.util.Properties attributes)
          Construct a new property of type XML.
protected Property(Property p)
          Construct a property as a copy
 
Method Summary
static IProperty createContentLanguageProp(java.lang.String value)
           
static IProperty createContentLengthProp(long length)
           
static IProperty createContentTypeProp(java.lang.String value)
           
static IProperty createCreatedByProp(java.lang.String value)
           
static IProperty createCreationDateProp(java.util.Date date)
           
static IProperty createDescriptionProp(java.lang.String value)
           
static IProperty createDisplaynameProp(java.lang.String value)
           
static IProperty createETagProp(java.lang.String value)
           
static IProperty createHiddenProp(boolean value)
           
static IProperty createLastModifiedByProp(java.lang.String value)
           
static IProperty createLastModifiedProp(java.util.Date date)
           
static IProperty createReadOnlyProp(boolean value)
           
static IProperty createResourceTypeProp(java.lang.String value)
           
 boolean equals(java.lang.Object prop)
           
 java.lang.String getAttribute(java.lang.String name)
          Get the value of an attribute
 java.util.Properties getAttributes()
          Returns a collection of attributes
 boolean getBooleanValue()
          Get the property value if the type is PropertyType.BOOLEAN
 java.util.Date getDateValue()
          Get the property value if the type is PropertyType.DATE
 java.lang.String getDescription()
          Returns the description of the property
 java.lang.String getDescription(IResourceContext context)
           
 int getIntValue()
          Get the property value if the type is PropertyType.INTEGER
 long getLongIntValue()
          Get the property value if the type is PropertyType.LONG
 IMutableProperty getMutable()
          Returns a copy of this propertry that can be modified
 IPropertyDef getPropertyDef()
          Get a reference to the proeprty definition.
 IPropertyName getPropertyName()
          Returns the property name
 java.lang.String getStringValue()
          Get the property value if the type is String
 PropertyType getType()
          Return the property's data type
 java.lang.Object getValue()
          Returns the property value as a Object if this is not a multi-valued property.
 java.lang.String getValueAsString()
          Get the property value converted to a string.
 java.util.List getValues()
          Returns the property values if this is a multi-valued property.
 boolean isMultivalued()
          Returns true if the property is multi-valued
static boolean isSystemProperty(IPropertyName propName)
          Returns true if it is the name of a system property
 java.lang.String toString()
           
protected  void validateType(java.lang.Object v)
          Validates the instance of the property value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_value

protected java.lang.String m_value
The value

m_value_object

protected java.lang.Object m_value_object

m_dateValue

protected java.util.Date m_dateValue
The value if the type is Date

m_values

protected java.util.List m_values
Values of multivalued property

m_attributes

protected java.util.Properties m_attributes
The collection of property attributes

m_res

protected ResourceBundles m_res
Constructor Detail

Property

public Property(IPropertyName name,
                java.lang.String value)
         throws ResourceException
Construct a new property of type STRING.
Parameters:
name - The property name
value - The property string value

Property

public Property(IPropertyName name,
                java.util.Date value)
         throws ResourceException
Construct a new property of type DATE.
Parameters:
name - The property name
value - The property date value

Property

public Property(IPropertyName name,
                java.lang.Boolean value)
         throws ResourceException
Construct a new property of type BOOLEAN.
Parameters:
name - The property name
value - The property boolean value

Property

public Property(IPropertyName name,
                java.lang.Integer value)
         throws ResourceException
Construct a new property of type INTEGER.
Parameters:
name - The property name
value - The property integer value

Property

public Property(IPropertyName name,
                java.lang.Long value)
         throws ResourceException
Construct a new property of type LONG.
Parameters:
name - The property name
value - The property long value

Property

public Property(IPropertyName name,
                XMLMarkup value)
         throws ResourceException
Construct a new property of type XML.
Parameters:
name - The property name
value - The property xml value

Property

public Property(IPropertyName name,
                PropertyType type,
                java.util.List values)
         throws ResourceException
Construct a new multi-valued property.
Parameters:
name - The property name
type - The property data type
values - A list of values. The list must contain suitable object instances (String, Date, Integer, Long, Boolean, XMLMarkup) for the specified property type.
Throws:
ResourceException - If the instance of the value does not match the property type

Property

public Property(IPropertyName name,
                java.lang.Object value)
         throws ResourceException
Construct a new property. The value object's instance must be one of String, Integer, Long, Boolean, Date or XMLMarkup.
Parameters:
name - The property name
value - The value object
Throws:
ResourceException - If the instance of the value parameter is not allowed

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.String value)
         throws ResourceException
Construct a new property of type STRING.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.util.Date value)
         throws ResourceException
Construct a new property of type DATE.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Boolean value)
         throws ResourceException
Construct a new property of type BOOLEAN.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Integer value)
         throws ResourceException
Construct a new property of type INTEGER.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Long value)
         throws ResourceException
Construct a new property of type LONG.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                XMLMarkup value)
         throws ResourceException
Construct a new property of type XML.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Object value)
         throws ResourceException
Construct a new property. The value object's instance must be one of String, Integer, Long, Boolean, Date or XMLMarkup and must match the PropertyDef's type.
Parameters:
name - The property name
def - The property definition
value - The value object
Throws:
ResourceException - If the instance of the value parameter is not allowed or does not matach the type

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.util.List values)
         throws ResourceException
Construct a new multi-valued property.
Parameters:
name - The property name
def - The property definition
values - A list of values. The list must contain suitable object instances (String, Date, Integer, Long, Boolean, XMLMarkup) for the specified property type.
Throws:
ResourceException - If the instance of the value does not match the property type

Property

public Property(IPropertyName name,
                java.lang.String value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type STRING.
Parameters:
name - The property name
value - The property string value
attributes -  

Property

public Property(IPropertyName name,
                java.util.Date value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type DATE.
Parameters:
name - The property name
value - The property date value
attributes -  

Property

public Property(IPropertyName name,
                java.lang.Boolean value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type BOOLEAN.
Parameters:
name - The property name
value - The property booelan value
attributes -  

Property

public Property(IPropertyName name,
                java.lang.Integer value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type INTEGER.
Parameters:
name - The property name
value - The property integer value

Property

public Property(IPropertyName name,
                java.lang.Long value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type LONG.
Parameters:
name - The property name
value - The property long value

Property

public Property(IPropertyName name,
                XMLMarkup value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type XML.
Parameters:
name - The property name
value - The property xml value

Property

public Property(IPropertyName name,
                java.lang.Object value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property. The value object's instance must be one of String, Integer, Long, Boolean, Date or XMLMarkup.
Parameters:
name - The property name
value - The value object
attributes -  
Throws:
ResourceException - If the instance of the value parameter is not allowed

Property

public Property(IPropertyName name,
                PropertyType type,
                java.util.List values,
                java.util.Properties attributes)
         throws ResourceException
Construct a new multi-valued property.
Parameters:
name - The property name
type - The property data type
values - A list of values. The list must contain suitable object instances (String, Date, Integer, Long, Boolean, XMLMarkup) for the specified property type.
attributes -  
Throws:
ResourceException - If the instance of the value does not match the property type

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.String value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type STRING.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.util.Date value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type DATE.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Boolean value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type BOOLEAN.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Integer value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type INTEGER.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Long value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type LONG.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                XMLMarkup value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property of type XML.
Parameters:
name - The property name
def - The property definition
value - The property string value

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.lang.Object value,
                java.util.Properties attributes)
         throws ResourceException
Construct a new property. The value object's instance must be one of String, Integer, Long, Boolean, Date or XMLMarkup and must match the PropertyDef's type.
Parameters:
name - The property name
def - The property definition
value - The value object
attributes -  
Throws:
ResourceException - If the instance of the value parameter is not allowed or does not matach the type

Property

public Property(IPropertyName name,
                IPropertyDef def,
                java.util.List values,
                java.util.Properties attributes)
         throws ResourceException
Construct a new multi-valued property.
Parameters:
name - The property name
def - The property definition
values - A list of values. The list must contain suitable object instances (String, Date, Integer, Long, Boolean, XMLMarkup) for the specified property type.
attributes -  
Throws:
ResourceException - If the instance of the value does not match the property type

Property

protected Property(Property p)
Construct a property as a copy
Parameters:
p -  

Property

protected Property(IPropertyName name,
                   IPropertyDef def)
            throws ResourceException

Property

protected Property(IPropertyName name,
                   PropertyType type,
                   boolean isMultivalued)
            throws ResourceException
Method Detail

getPropertyName

public IPropertyName getPropertyName()
Description copied from interface: IProperty
Returns the property name
Specified by:
getPropertyName in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
A property name object

getType

public PropertyType getType()
Description copied from interface: IProperty
Return the property's data type
Specified by:
getType in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
A property type constant

isMultivalued

public boolean isMultivalued()
Description copied from interface: IProperty
Returns true if the property is multi-valued
Specified by:
isMultivalued in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
multivalued

getPropertyDef

public IPropertyDef getPropertyDef()
Description copied from interface: IProperty
Get a reference to the proeprty definition.
Specified by:
getPropertyDef in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The property definition

getValueAsString

public java.lang.String getValueAsString()
Description copied from interface: IProperty
Get the property value converted to a string.
Specified by:
getValueAsString in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
A String

getBooleanValue

public boolean getBooleanValue()
Description copied from interface: IProperty
Get the property value if the type is PropertyType.BOOLEAN
Specified by:
getBooleanValue in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The value

getIntValue

public int getIntValue()
Description copied from interface: IProperty
Get the property value if the type is PropertyType.INTEGER
Specified by:
getIntValue in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The value

getLongIntValue

public long getLongIntValue()
Description copied from interface: IProperty
Get the property value if the type is PropertyType.LONG
Specified by:
getLongIntValue in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The value

getDateValue

public java.util.Date getDateValue()
Description copied from interface: IProperty
Get the property value if the type is PropertyType.DATE
Specified by:
getDateValue in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The value

getStringValue

public java.lang.String getStringValue()
Description copied from interface: IProperty
Get the property value if the type is String
Specified by:
getStringValue in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The value

getValues

public java.util.List getValues()
                         throws ResourceException
Description copied from interface: IProperty
Returns the property values if this is a multi-valued property.
Specified by:
getValues in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
An unmodifiable List of value objects (String, Date, Integer, Long, Boolean, XMLMarkup)

getValue

public java.lang.Object getValue()
                          throws ResourceException
Description copied from interface: IProperty
Returns the property value as a Object if this is not a multi-valued property.
Specified by:
getValue in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The value object (String, Date, Integer, Long, Boolean, XMLMarkup)

getMutable

public IMutableProperty getMutable()
Description copied from interface: IProperty
Returns a copy of this propertry that can be modified
Specified by:
getMutable in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
A mutable property instance

getAttribute

public java.lang.String getAttribute(java.lang.String name)
                              throws ResourceException
Description copied from interface: IProperty
Get the value of an attribute
Specified by:
getAttribute in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Parameters:
name - Attribute name
Returns:
The value, ot null if the name does not exist
Throws:
ResourceException -  

getAttributes

public java.util.Properties getAttributes()
                                   throws ResourceException
Description copied from interface: IProperty
Returns a collection of attributes
Specified by:
getAttributes in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
The attributes
Throws:
ResourceException -  

getDescription

public java.lang.String getDescription()
                                throws WcmException
Description copied from interface: IProperty
Returns the description of the property
Specified by:
getDescription in interface IProperty
Following copied from interface: com.sapportals.wcm.repository.IProperty
Returns:
description
Throws:
WcmException - Exception raised in failure situation

getDescription

public java.lang.String getDescription(IResourceContext context)
                                throws WcmException
Specified by:
getDescription in interface IProperty

toString

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

equals

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

validateType

protected void validateType(java.lang.Object v)
                     throws ResourceException
Validates the instance of the property value
Parameters:
v - The value to set

isSystemProperty

public static boolean isSystemProperty(IPropertyName propName)
                                throws ResourceException
Returns true if it is the name of a system property
Parameters:
propName -  
Returns:
Boolean value

createCreatedByProp

public static IProperty createCreatedByProp(java.lang.String value)
                                     throws ResourceException

createLastModifiedByProp

public static IProperty createLastModifiedByProp(java.lang.String value)
                                          throws ResourceException

createCreationDateProp

public static IProperty createCreationDateProp(java.util.Date date)
                                        throws ResourceException

createHiddenProp

public static IProperty createHiddenProp(boolean value)
                                  throws ResourceException

createLastModifiedProp

public static IProperty createLastModifiedProp(java.util.Date date)
                                        throws ResourceException

createDescriptionProp

public static IProperty createDescriptionProp(java.lang.String value)
                                       throws ResourceException

createDisplaynameProp

public static IProperty createDisplaynameProp(java.lang.String value)
                                       throws ResourceException

createReadOnlyProp

public static IProperty createReadOnlyProp(boolean value)
                                    throws ResourceException

createContentLengthProp

public static IProperty createContentLengthProp(long length)
                                         throws ResourceException

createContentTypeProp

public static IProperty createContentTypeProp(java.lang.String value)
                                       throws ResourceException

createETagProp

public static IProperty createETagProp(java.lang.String value)
                                throws ResourceException

createContentLanguageProp

public static IProperty createContentLanguageProp(java.lang.String value)
                                           throws ResourceException

createResourceTypeProp

public static IProperty createResourceTypeProp(java.lang.String value)
                                        throws ResourceException

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.