SAP NetWeaver '04

com.sap.netweaver.bc.rf.common.property
Class AbstractProperty

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.common_api.jar]
java.lang.Object
  |
  +--com.sap.netweaver.bc.rf.common.property.AbstractProperty
All Implemented Interfaces:
IProperty, java.io.Serializable
Direct Known Subclasses:
BooleanMultiValueProperty, BooleanSingleValueProperty, DateMultiValueProperty, DateSingleValueProperty, IntMultiValueProperty, IntSingleValueProperty, LongMultiValueProperty, LongSingleValueProperty, StringMultiValueProperty, StringSingleValueProperty, XmlMultiValueProperty, XmlSingleValueProperty

public abstract class AbstractProperty
extends java.lang.Object
implements IProperty, java.io.Serializable

Class implementing a lean property (for less memory consumption), which is part of the resource and describes certain aspects of it. A property has a name (IPropertyName), type (PropertyType), some internal system attributes (PropertyFlags), some more arbitrary attributes, a natural language description and most important a value. For each type exists a specific property interface and implementation extending this interface.

See Also:
IProperty, PropertyFlags, Serialized Form

Field Summary
protected  java.util.Properties attributes
           
protected  int flags
           
protected  IPropertyName name
           
protected  ResourceBundles resourceBundles
           
 
Constructor Summary
protected AbstractProperty(IPropertyName name, java.util.Properties attributes, int flags, ResourceBundles resourceBundles)
          Construct property instance based on its internals.
 
Method Summary
 boolean areFlagsSet()
          Return true if the internal system attributes are set.
 boolean equals(java.lang.Object obj)
          Check this and another object for equality.
 java.lang.String getAttribute(java.lang.String attributeName)
          Get attribute for the property.
 java.util.Properties getAttributes()
          Get all attributes for the property at once.
 java.lang.String getDescription()
          Get description of property.
 java.lang.String getDescription(java.util.Locale locale)
          Get localized description of property.
 int getFlags()
          Get bit array holding internal system attributes according to PropertyFlags bit mask fields.
 IPropertyName getPropertyName()
          Get immutable name of this property.
 int hashCode()
          Get hash code of this object.
 boolean isHidden()
          Returns true if this property is hidden.
 boolean isLive()
          Returns true if this property is live.
 boolean isReadOnly()
          Returns true if this property is read only.
 boolean isRequired()
          Returns true if this property is required.
 java.lang.String toString()
          Get string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sap.netweaver.bc.rf.common.property.IProperty
getType, getValueAsString, getValuesAsStrings, isMultiValue
 

Field Detail

name

protected IPropertyName name

attributes

protected java.util.Properties attributes

flags

protected int flags

resourceBundles

protected ResourceBundles resourceBundles
Constructor Detail

AbstractProperty

protected AbstractProperty(IPropertyName name,
                           java.util.Properties attributes,
                           int flags,
                           ResourceBundles resourceBundles)
                    throws ResourceException
Construct property instance based on its internals.
Parameters:
name - property name
attributes - property attributes
flags - bit array holding internal system attributes according to PropertyFlags bit mask fields
resourceBundles - resource bundles containing (localized) property description
Throws:
ResourceException - when the property creation failed
Method Detail

getPropertyName

public IPropertyName getPropertyName()
Get immutable name of this property.
Specified by:
getPropertyName in interface IProperty
Returns:
immutable name of this property

areFlagsSet

public boolean areFlagsSet()
Return true if the internal system attributes are set.
Specified by:
areFlagsSet in interface IProperty
Returns:
true if the internal system attributes are set

getFlags

public int getFlags()
Get bit array holding internal system attributes according to PropertyFlags bit mask fields.
Specified by:
getFlags in interface IProperty
Returns:
bit array holding internal system attributes according to PropertyFlags bit mask fields

isRequired

public boolean isRequired()
Returns true if this property is required.
Specified by:
isRequired in interface IProperty
Returns:
true if this property is required

isLive

public boolean isLive()
Returns true if this property is live.
Specified by:
isLive in interface IProperty
Returns:
true if this property is live

isReadOnly

public boolean isReadOnly()
Returns true if this property is read only.
Specified by:
isReadOnly in interface IProperty
Returns:
true if this property is read only

isHidden

public boolean isHidden()
Returns true if this property is hidden.
Specified by:
isHidden in interface IProperty
Returns:
true if this property is hidden

getDescription

public java.lang.String getDescription()
Get description of property. Usually the description will be looked up in a resource bundle using the property name as key. If no resource bundle is provided, the property name may be returned.
Specified by:
getDescription in interface IProperty
Returns:
description of property

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Get localized description of property. Usually the localized description will be looked up in a resource bundle using the property name as key. If no resource bundle is provided, the property name may be returned.
Specified by:
getDescription in interface IProperty
Parameters:
locale - locale to be used for localization
Returns:
localized description of property

getAttributes

public java.util.Properties getAttributes()
                                   throws ResourceException
Get all attributes for the property at once. The returned attribute map will be the stored one (as is - without being copied). Note that the stored attribute map is no longer connected to the property when it is set by a setAttributes() call.
Specified by:
getAttributes in interface IProperty
Returns:
property map holding all attributes
Throws:
ResourceException - when the property is invalid

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName)
                              throws ResourceException
Get attribute for the property.
Specified by:
getAttribute in interface IProperty
Parameters:
attributeName - attribute name
Returns:
attribute value
Throws:
ResourceException - when the attribute name or the property is invalid

hashCode

public int hashCode()
Get hash code of this object. The hash code will be computed only based on the property name.
Overrides:
hashCode in class java.lang.Object
Returns:
hash code of this object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Check this and another object for equality. The equality will be computed only based on the property name.
Overrides:
equals in class java.lang.Object
Parameters:
obj - object to compare this object with
Returns:
true if both objects are considered to be equal, false otherwise
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Get string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
string representation of this object
See Also:
Object.toString()

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.