com.waveset.object
Class Property

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.Property
All Implemented Interfaces:
com.sun.idm.debugger.common.Locatable, javax.naming.Referenceable, XmlObject

public class Property
extends AbstractXmlObject
implements com.sun.idm.debugger.common.Locatable

An object that encapsulates the definition of a "property", which which may be associated with another object. The object to which the properties apply is called the host object. Property objects may be maintined in a list directly on the host object, or they may be aggregated into an intermediate container that is referenced by the host object, an example of an property container is the FieldDisplay object, which is referenced by Form.Field.

A property is essentially a name/value pair, the value may be either static, or calculated with XPRESS.


Field Summary
static java.lang.String code_id
           
static java.lang.String ELEMENT
          Name of the serialized XML element.
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
Property()
           
Property(org.w3c.dom.Element e)
          Constructor for XmlObjectFactory
Property(org.w3c.dom.Element e, ExEnvironment env)
          Sigh, if you want to call functions or reference variables, you need to pass in an ExEnvironment object, typically one owned by the host object.
Property(java.lang.String name, ExNode exp)
           
Property(java.lang.String name, java.lang.Object value)
           
 
Method Summary
static void clearOwner(java.util.List properties)
          Clears the owner for a list of properties
static void clearOwner(Property property)
          Clears the owner for a property
 java.lang.String getElementName()
          Return the element name.
 ExNode getExpression()
           
 com.sun.idm.debugger.common.Location getLocation()
           
 java.lang.String getName()
          Get the property name.
 java.lang.Object getOwner()
           
static Property getProperty(java.util.List list, java.lang.String name)
          Lookup a Property object maintained in a List.
static java.lang.Object getPropertyValue(java.util.List list, java.lang.String name)
           
 java.lang.String getString()
          Get the fixed value with coercion.
 java.lang.String getString(ExState state)
           
 java.lang.Object getValue()
          Get the fixed value.
 java.lang.Object getValue(ExState state)
          Get the fixed value, or evaluate the expression.
 void link(ExEnvironment env)
           
static void link(ExEnvironment env, java.util.List list)
           
 void parseXml(org.w3c.dom.Element e, ExEnvironment env)
           
static java.util.List parseXmlList(org.w3c.dom.Element wrapper, ExEnvironment env)
          Parse a wrapper element containing a list of Property elements into a List of Property objects.
static java.util.Map parseXmlMap(org.w3c.dom.Element wrapper, ExEnvironment env)
          Parse a wrapper element containing a list of Property elements into a Map of Property objects.
 void setExpression(ExNode ex)
           
 void setLocation(com.sun.idm.debugger.common.Location l)
           
 void setName(java.lang.String s)
           
static void setOwner(java.util.List properties, java.lang.Object owner)
          Sets the owner for a list of properties
 void setOwner(java.lang.Object owner)
           
static void setOwner(Property property, java.lang.Object owner)
          Sets the owner for a property
static java.util.List setProperty(java.util.List list, java.lang.String name, java.lang.Object value)
          Assign a property to a property list.
 void setValue(java.lang.Object o)
           
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize into a buffer with optional indentation.
static void toXml(java.lang.StringBuffer b, int indent, java.lang.String wrapper, java.util.List properties)
          Property objects are almost always maintained in a List in its container.
static void toXml(java.lang.StringBuffer b, int indent, java.lang.String wrapper, java.util.Map properties)
          Serialize a Map of Property objects.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

ELEMENT

public static final java.lang.String ELEMENT
Name of the serialized XML element.

See Also:
Constant Field Values
Constructor Detail

Property

public Property()

Property

public Property(org.w3c.dom.Element e,
                ExEnvironment env)
         throws WavesetException
Sigh, if you want to call functions or reference variables, you need to pass in an ExEnvironment object, typically one owned by the host object. If you do not pass in an environment, the expressions may not call functions or reference s. You can also call link() later to assign the environment.


Property

public Property(org.w3c.dom.Element e)
         throws WavesetException
Constructor for XmlObjectFactory


Property

public Property(java.lang.String name,
                java.lang.Object value)

Property

public Property(java.lang.String name,
                ExNode exp)
Method Detail

setName

public void setName(java.lang.String s)

setValue

public void setValue(java.lang.Object o)

getOwner

public java.lang.Object getOwner()

setOwner

public void setOwner(java.lang.Object owner)

setExpression

public void setExpression(ExNode ex)

link

public void link(ExEnvironment env)

link

public static void link(ExEnvironment env,
                        java.util.List list)

setLocation

public void setLocation(com.sun.idm.debugger.common.Location l)
Specified by:
setLocation in interface com.sun.idm.debugger.common.Locatable

getLocation

public com.sun.idm.debugger.common.Location getLocation()
Specified by:
getLocation in interface com.sun.idm.debugger.common.Locatable

getElementName

public java.lang.String getElementName()
Description copied from class: AbstractXmlObject
Return the element name.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

getName

public java.lang.String getName()
Get the property name.


getValue

public java.lang.Object getValue()
Get the fixed value.


getString

public java.lang.String getString()
Get the fixed value with coercion.


getExpression

public ExNode getExpression()

getValue

public java.lang.Object getValue(ExState state)
                          throws WavesetException
Get the fixed value, or evaluate the expression. The evaluation state must be passed in.

Throws:
WavesetException

getString

public java.lang.String getString(ExState state)
                           throws WavesetException
Throws:
WavesetException

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Description copied from class: AbstractXmlObject
Serialize into a buffer with optional indentation. This must be implemented by the subclass.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject

parseXml

public void parseXml(org.w3c.dom.Element e,
                     ExEnvironment env)
              throws WavesetException
Throws:
WavesetException

toXml

public static void toXml(java.lang.StringBuffer b,
                         int indent,
                         java.lang.String wrapper,
                         java.util.List properties)
Property objects are almost always maintained in a List in its container. Rather than making every container deal with the serialization, we provide some static helper methods.


toXml

public static void toXml(java.lang.StringBuffer b,
                         int indent,
                         java.lang.String wrapper,
                         java.util.Map properties)
Serialize a Map of Property objects.


parseXmlList

public static java.util.List parseXmlList(org.w3c.dom.Element wrapper,
                                          ExEnvironment env)
                                   throws WavesetException
Parse a wrapper element containing a list of Property elements into a List of Property objects.

The ExEnvironment should be passed in if you want the property expressions to be able to reference or .

Throws:
WavesetException

parseXmlMap

public static java.util.Map parseXmlMap(org.w3c.dom.Element wrapper,
                                        ExEnvironment env)
                                 throws WavesetException
Parse a wrapper element containing a list of Property elements into a Map of Property objects.

The ExEnvironment should be passed in if you want the property expressions to be able to reference or .

Throws:
WavesetException

getProperty

public static Property getProperty(java.util.List list,
                                   java.lang.String name)
Lookup a Property object maintained in a List.


getPropertyValue

public static java.lang.Object getPropertyValue(java.util.List list,
                                                java.lang.String name)

setProperty

public static java.util.List setProperty(java.util.List list,
                                         java.lang.String name,
                                         java.lang.Object value)
Assign a property to a property list.


setOwner

public static void setOwner(Property property,
                            java.lang.Object owner)
Sets the owner for a property


clearOwner

public static void clearOwner(Property property)
Clears the owner for a property


setOwner

public static void setOwner(java.util.List properties,
                            java.lang.Object owner)
Sets the owner for a list of properties


clearOwner

public static void clearOwner(java.util.List properties)
Clears the owner for a list of properties