com.crystaldecisions.sdk.occa.report.data
Class ExpressionValue

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.Value
      extended by com.crystaldecisions.sdk.occa.report.data.ExpressionValue
All Implemented Interfaces:
IExpressionValue, IValue, IClone

public class ExpressionValue
extends Value
implements IExpressionValue, IClone

This object represents a value that needs to be evaluated. Examples of ExpressionValues are: 2+2, 3*4, {Customer.Last Year's Sales}.

Literal values, defined as values that do not need to be evaluated, are stored using the ConstantValue Object. The ExpressionValue object is used by the FieldRangeFilterItem object to store values in primitive expressions of filters.

Use the IExpressionValue interface to get and set values for the expression.


Constructor Summary
ExpressionValue()
           
ExpressionValue(IExpressionValue src)
           
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 java.lang.String computeText()
          The ComputeText method returns a String representation of the field value that can be used in a report formula.
 void copyTo(java.lang.Object destObject, boolean deepCopy)
           
 java.lang.Object createMember(java.lang.String eleName, org.xml.sax.Attributes attrs, XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
          For internal use only.
 java.lang.String displayText(java.util.Locale locale)
          Returns the field's value as a localized and formatted String.
 void endElement(java.lang.String eleName, java.util.Map objState)
          For internal use only.
 java.lang.String getExpression()
          Returns the value.
 boolean hasContent(java.lang.Object srcExpressionValue)
           
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
          For internal use only.
 void save(XMLWriter writer, java.lang.String sTag, XMLSerializationContext ctxt)
          For internal use only.
 void save(XMLWriter writer, XMLSerializationContext ctxt)
          For internal use only.
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
          For internal use only.
 void setExpression(java.lang.String expression)
           Sets the value.
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
           For internal use only.
 
Methods inherited from class com.crystaldecisions.sdk.occa.report.data.Value
doControllerModification, enumerateMembers, getControllableMixin, isDirectlyControllable, toComputeText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionValue

public ExpressionValue(IExpressionValue src)

ExpressionValue

public ExpressionValue()
Method Detail

clone

public java.lang.Object clone(boolean deepClone)
Specified by:
clone in class Value

computeText

public java.lang.String computeText()
Description copied from interface: IValue

The ComputeText method returns a String representation of the field value that can be used in a report formula.

The String is not formatted or localized. The syntax will always be Crystal syntax. If the field contains a date, ComputeText returns Date(x, x, x); if it contains a date and time, ComputeText returns DateTime(x, x, x, x, x, x). However, when the date is 1900, 0, 1 (the Java start date), ComputeText returns Time(x, x, x). If you want to set a field to a time value only (that is, with no date), you should set the date to 1900, 0, 1, so that ComputeText will retrieve the correct information.

Specified by:
computeText in interface IValue
Specified by:
computeText in class Value
Returns:
A String representation of the field value that can be used in a report formula.

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)
Specified by:
copyTo in class Value

createMember

public java.lang.Object createMember(java.lang.String eleName,
                                     org.xml.sax.Attributes attrs,
                                     XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)
Description copied from class: Value

For internal use only.

Overrides:
createMember in class Value

displayText

public java.lang.String displayText(java.util.Locale locale)
Description copied from interface: IValue

Returns the field's value as a localized and formatted String. The Locale can be a java.util.Locale value.

The value is formatted according to the locale. The user is required to pass in a locale; the system default locale or user default locale is not used. If the field contains a date, displayText returns a locale-specific date string; if it contains a date and time, displayText returns a locale-specific date time String; if it contains a time String, displayText returns a locale-specific time String.

Specified by:
displayText in interface IValue
Specified by:
displayText in class Value
Parameters:
locale - The locale as specified by java.util.Locale .
Returns:
The field's value as a localized and formatted String.

endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)
Description copied from class: Value

For internal use only.

Overrides:
endElement in class Value

getExpression

public java.lang.String getExpression()
Description copied from interface: IExpressionValue

Returns the value. This is not the evaluated result but rather, the expression itself. Examples of ExpressionValues are: 2+2, 3*4, {Customer.Last Year's Sales}.

Specified by:
getExpression in interface IExpressionValue
Returns:
The unevaluated expression as a String.

hasContent

public boolean hasContent(java.lang.Object srcExpressionValue)
Specified by:
hasContent in class Value

readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)
Description copied from class: Value

For internal use only.

Overrides:
readElement in class Value

save

public void save(XMLWriter writer,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
Description copied from class: Value

For internal use only.

Overrides:
save in class Value
Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
Description copied from class: Value

For internal use only.

Overrides:
save in class Value
Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException
Description copied from class: Value

For internal use only.

Overrides:
saveContents in class Value
Throws:
java.io.IOException

setExpression

public void setExpression(java.lang.String expression)
Description copied from interface: IExpressionValue

Sets the value. This is not the evaluated result but rather, the expression itself. Examples of ExpressionValues are: 2+2, 3*4, {Customer.Last Year's Sales}.

Specified by:
setExpression in interface IExpressionValue
Parameters:
expression - The unevaluated expression as a String.

startElement

public void startElement(java.lang.String eleName,
                         java.util.Map objState,
                         org.xml.sax.Attributes attrs)

For internal use only.