org.liquidsite.core.content
Class DocumentProperty

java.lang.Object
  extended byorg.liquidsite.core.content.DocumentProperty
All Implemented Interfaces:
java.lang.Comparable

public class DocumentProperty
extends java.lang.Object
implements java.lang.Comparable

A document property container. This class defines the meta-data for a document property, but not the property value itself.


Field Summary
static int HTML_TYPE
          The HTML type constant.
static int STRING_TYPE
          The string type constant.
static int TAGGED_TYPE
          The tagged type constant.
 
Constructor Summary
DocumentProperty(java.lang.String id)
          Creates a new document property.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this object to another object.
 java.lang.String encodeXml()
          Encodes all the values in the document property to an XML string.
 java.lang.String getDescription()
          Returns the document property description.
 java.lang.String getId()
          Returns the unique document property identifier.
 java.lang.String getName()
          Returns the document property name.
 int getPosition()
          Returns the document property position.
 int getType()
          Returns the document property type.
 void setDescription(java.lang.String description)
          Sets the document property description.
 void setName(java.lang.String name)
          Sets the document property name.
 void setPosition(int position)
          Sets the document property position.
 void setType(int type)
          Sets the document property type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_TYPE

public static final int STRING_TYPE
The string type constant. The string type represents document properties that are input using a simple HTML input field, i.e. a string without newlines.

See Also:
Constant Field Values

TAGGED_TYPE

public static final int TAGGED_TYPE
The tagged type constant. The tagged type represents document properties that are input using a textarea HTML input field and contains special tags for formatting.

See Also:
Constant Field Values

HTML_TYPE

public static final int HTML_TYPE
The HTML type constant. The HTML type represents document properties that are input using an HTML editor field, i.e. a string containing HTML markup.

See Also:
Constant Field Values
Constructor Detail

DocumentProperty

public DocumentProperty(java.lang.String id)
Creates a new document property.

Parameters:
id - the document property identifier
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
              throws java.lang.ClassCastException
Compares this object to another object. The comparison will only work with other document property objects, and will compare the position numbers.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object to compare with
Returns:
less than zero (0) if this object is previous, zero if the objects are equal, or greater than zero otherwise
Throws:
java.lang.ClassCastException - if the specified object wasn't a document property

getId

public java.lang.String getId()
Returns the unique document property identifier.

Returns:
the unique document property identifier

getName

public java.lang.String getName()
Returns the document property name.

Returns:
the document property name

setName

public void setName(java.lang.String name)
Sets the document property name.

Parameters:
name - the new name

getPosition

public int getPosition()
Returns the document property position.

Returns:
the document property position

setPosition

public void setPosition(int position)
Sets the document property position.

Parameters:
position - the new position

getType

public int getType()
Returns the document property type.

Returns:
the document property type
See Also:
STRING_TYPE, TAGGED_TYPE, HTML_TYPE

setType

public void setType(int type)
Sets the document property type.

Parameters:
type - the new type
See Also:
STRING_TYPE, TAGGED_TYPE, HTML_TYPE

getDescription

public java.lang.String getDescription()
Returns the document property description.

Returns:
the document property description

setDescription

public void setDescription(java.lang.String description)
Sets the document property description.

Parameters:
description - the new description

encodeXml

public java.lang.String encodeXml()
Encodes all the values in the document property to an XML string.

Returns:
the XML-encoded property values