com.wewebu.ow.server.ecm
Class OwStandardProperty

java.lang.Object
  extended by com.wewebu.ow.server.ecm.OwStandardProperty
All Implemented Interfaces:
OwProperty, OwField, Cloneable, Comparable

public class OwStandardProperty
extends Object
implements OwProperty, Cloneable

Standard Implementation for object properties.
A property contains the name and value of a object property.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
protected  OwPropertyClass m_PropertyClass
          class description of the property
protected  Object m_Value
          value of the property
 
Constructor Summary
OwStandardProperty(Object value_p, OwPropertyClass propertyClass_p)
          construct Property Object and set members
 
Method Summary
 Object clone()
          create a copy of the object
 int compareTo(Object obj_p)
          implementation of java.lang.Comparable interface Compares this object with the specified object for order.
 OwFieldDefinition getFieldDefinition()
          get the corresponding field definition of the field
 Object getNativeObject()
          get the native object from the ECM system WARNING: The returned object is Opaque.
 OwPropertyClass getPropertyClass()
          get the class description of the property
 Object getValue()
          get the value of the property.
 boolean isHidden(int iContext_p)
          check if property is visible to the user
 boolean isReadOnly(int iContext_p)
          check if property is read only on the instance level NOTE: isReadOnly is also defined in OwPropertyClass on the class level.
 void setValue(Object oValue_p)
          set the value of the property.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Value

protected Object m_Value
value of the property


m_PropertyClass

protected OwPropertyClass m_PropertyClass
class description of the property

Constructor Detail

OwStandardProperty

public OwStandardProperty(Object value_p,
                          OwPropertyClass propertyClass_p)
construct Property Object and set members

Method Detail

clone

public Object clone()
create a copy of the object

Specified by:
clone in interface OwProperty
Overrides:
clone in class Object
Returns:
OwProperty copy of this object

compareTo

public int compareTo(Object obj_p)
implementation of java.lang.Comparable interface Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.) The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0. Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z. It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

Specified by:
compareTo in interface Comparable
Parameters:
obj_p - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

getPropertyClass

public OwPropertyClass getPropertyClass()
                                 throws Exception
get the class description of the property

Specified by:
getPropertyClass in interface OwProperty
Throws:
Exception

getFieldDefinition

public OwFieldDefinition getFieldDefinition()
                                     throws Exception
get the corresponding field definition of the field

Specified by:
getFieldDefinition in interface OwField
Returns:
OwFieldDefinition
Throws:
Exception

getValue

public Object getValue()
                throws Exception
get the value of the property. Can also be a list of values (see OwPropertyClass.isArray)

Specified by:
getValue in interface OwField
Returns:
Object value of property if property is scalar, or a java.io.List of objects if Property is an array
Throws:
Exception

setValue

public void setValue(Object oValue_p)
              throws Exception
set the value of the property. Can also be a list of values (see OwPropertyClass.isArray)

Specified by:
setValue in interface OwField
Parameters:
oValue_p - value of property if property is scalar, or a java.io.List of objects if Property is an array
Throws:
Exception

isReadOnly

public boolean isReadOnly(int iContext_p)
                   throws Exception
check if property is read only on the instance level NOTE: isReadOnly is also defined in OwPropertyClass on the class level. I.e. A Property might be defined as readable on the class level, but still be write protected on a specific instance.

Specified by:
isReadOnly in interface OwProperty
Parameters:
iContext_p - Context in which the property is read-only as defined by CONTEXT_...
Returns:
true if property is read only
Throws:
Exception

isHidden

public boolean isHidden(int iContext_p)
                 throws Exception
check if property is visible to the user

Specified by:
isHidden in interface OwProperty
Parameters:
iContext_p - Context in which the property is read-only as defined by CONTEXT_...
Returns:
true if property is visible to the user
Throws:
Exception

getNativeObject

public Object getNativeObject()
                       throws Exception
get the native object from the ECM system WARNING: The returned object is Opaque. Using the native object makes the client dependent on the ECM System

Specified by:
getNativeObject in interface OwProperty
Returns:
no native object available
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.