tribble.archive
Class DocumentProperty

java.lang.Object
  extended by tribble.archive.DocumentProperty
Direct Known Subclasses:
WritableProperty

public class DocumentProperty
extends java.lang.Object

Generic document property.

This class provides the fundamental attributes and methods for a document property that is associated with an archive document.

An archive document is composed of content data (such as an image, text, or other kind of user data) and one or more properties. All of the documents within an archive system typically share the same set of document properties, although this is not required of any implementation.

Document properties specify attributes of the document beyond the content data of the document, the meaning of which are defined by the implementation. For example, a given implementation might provide properties specifying things like a document's modification date, number of pages it contains, the names of its authors, its access permissions, its expiration date, an identification number shared by other related documents within the same batch, and so forth. In addition to the document ID, one or more of these properties might be used as the indices to store the document in the archive system.

Each document property has the following attributes:

There may be other attributes of the properties, which are specific to the particular subclass implementation of the archive system.

A given property that is associated with a particular archive document also has a value, which is an object of some sort. The values of the properties can be accessed for a given document that was retrieved by an ArchiveReader, by calling the ArchiveDocument.getProperty() method.

The value of a property is the minimum amount of information that is useful to an implementation. The other attributes may be used or ignored by the implementation as it deems necessary.

Note: This requires Java 1.5 or later.

Source code:
http://david.tribble.com/src/java/tribble/archive/DocumentProperty.java
Documentation:
http://david.tribble.com/docs/tribble/archive/DocumentProperty.html

Since:
2008-04-03
Version:
API 2.0, $Revision: 1.1 $ $Date: 2008/04/03 23:03:56 $
Author:
David R. Tribble (david@tribble.com) Copyright ©2004 by David R. Tribble, all rights reserved.
See Also:
WritableProperty, ArchiveDocument

Field Summary
protected  java.lang.Object m_dflVal
          Default output value.
protected  java.lang.String m_inFmt
          Input format (for non-String type properties).
protected  int m_len
          Text property length.
protected  java.lang.String m_name
          Property name.
protected  java.lang.String m_outFmt
          Output format (for non-String type properties).
protected  java.lang.String m_type
          Property type.
static java.lang.String TYPE_BINARY
          Property type: Binary data.
static java.lang.String TYPE_DATE
          Property type: Date/time.
static java.lang.String TYPE_FILE
          Property type: Filename.
static java.lang.String TYPE_NUM
          Property type: Numeric.
static java.lang.String TYPE_TEXT
          Property type: Alphanumeric text.
 
Constructor Summary
protected DocumentProperty(java.lang.String name)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares two objects for equality.
 java.lang.Object getDefaultValue()
          Retrieve the default value for this document property.
 java.lang.String getInputFormat()
          Retrieve the input (source) format specification for this document property.
 int getLength()
          Retrieve the length of this document property.
 java.lang.String getName()
          Retrieve the name of this document property.
 java.lang.String getOutputFormat()
          Retrieve the output format specification for this document property.
 java.lang.String getType()
          Retrieve the type of this document property.
 int hashCode()
          Generates a hash code for this property.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_TEXT

public static final java.lang.String TYPE_TEXT
Property type: Alphanumeric text.

See Also:
Constant Field Values

TYPE_BINARY

public static final java.lang.String TYPE_BINARY
Property type: Binary data.

See Also:
Constant Field Values

TYPE_NUM

public static final java.lang.String TYPE_NUM
Property type: Numeric.

See Also:
Constant Field Values

TYPE_DATE

public static final java.lang.String TYPE_DATE
Property type: Date/time.

See Also:
Constant Field Values

TYPE_FILE

public static final java.lang.String TYPE_FILE
Property type: Filename.

See Also:
Constant Field Values

m_name

protected java.lang.String m_name
Property name.


m_type

protected java.lang.String m_type
Property type. This can be one of the TYPE_XXX constants or some other application-defined value.


m_len

protected int m_len
Text property length.


m_outFmt

protected java.lang.String m_outFmt
Output format (for non-String type properties).


m_inFmt

protected java.lang.String m_inFmt
Input format (for non-String type properties).


m_dflVal

protected java.lang.Object m_dflVal
Default output value.

Constructor Detail

DocumentProperty

protected DocumentProperty(java.lang.String name)
Constructor.

Parameters:
name - The name of this document property.
Since:
API 2.0, 2008-04-03
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares two objects for equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare this object to.
Returns:
True if these objects are equal, false otherwise.
Since:
API 2.0, 2008-04-03

hashCode

public int hashCode()
Generates a hash code for this property.

Overrides:
hashCode in class java.lang.Object
Returns:
An integer hash code for this property.
Since:
API 2.0, 2008-04-03

getName

public java.lang.String getName()
Retrieve the name of this document property.

Returns:
The name of this property.
Since:
API 2.0, 2008-04-03

getType

public java.lang.String getType()
Retrieve the type of this document property.

Returns:
The type of this property, which is one of the TYPE_XXX constants or some other application-defined value, or null if it is not defined.
Since:
API 2.0, 2008-04-03

getLength

public int getLength()
Retrieve the length of this document property.

Returns:
The length of this document property, or zero if it is not defined.
Since:
API 2.0, 2008-04-03

getOutputFormat

public java.lang.String getOutputFormat()
Retrieve the output format specification for this document property.

Returns:
The formatting specification of this property, which specifies how the property value should be formatted when it is stored in an archive document; or null if it is not defined.
Since:
API 2.0, 2008-04-03

getInputFormat

public java.lang.String getInputFormat()
Retrieve the input (source) format specification for this document property.

Returns:
The source formatting specification of this property, which specifies the format of the property value before it is stored in an archive document (i.e., it specifies how the source value for this property should be unformatted when its value is set, prior to being reformatted when it is written to the archive); or null if it is not defined.
Since:
API 2.0, 2008-04-03

getDefaultValue

public java.lang.Object getDefaultValue()
Retrieve the default value for this document property.

Returns:
The default value to be used by this document property if it is not explicitly set to another value. This is null if the property has no default value established.
Since:
API 2.0, 2008-04-03