tribble.repository
Class WritableProperty

java.lang.Object
  extended by tribble.repository.DocumentProperty
      extended by tribble.repository.WritableProperty

public class WritableProperty
extends DocumentProperty

Generic modifiable document property.

This class provides the fundamental attributes and methods for a document property associated with a storable repository document.

A repository document is composed of content data (such as an image, text, or other kind of user data) and zero or more properties. Typically, the properties comprise the keys used to store the document in a document storage system. All of the documents within a repository system typically share the same set of document properties, although this is not required of any implementation.

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 repository system. For documents being written to a repository by an RepositoryWriter, a property can be associated with the document using the StorableDocument.addProperty() method (or by some other means provided by the implementation).

A given property that is associated with a particular repository document also has a value, which is an object of some sort. Once a property is associated with the document, its value can be set to some object using the StorableDocument.setProperty() 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/repository/WritableProperty.java
Documentation:
http://david.tribble.com/docs/tribble/repository/WritableProperty.html

Since:
2008-04-04
Version:
API 2.0, $Revision: 1.1 $ $Date: 2008/04/04 14:55:33 $
Author:
David R. Tribble (david@tribble.com)
Copyright ©2008 by David R. Tribble, all rights reserved.
Permission is granted to any person or entity except those designated by the United States Department of State as a terrorist or terrorist government or agency, to use and distribute this source code provided that the original copyright notice remains present and unaltered.
See Also:
StorableDocument, RepositoryWriter

Field Summary
 
Fields inherited from class tribble.repository.DocumentProperty
m_dflVal, m_inFmt, m_len, m_name, m_outFmt, m_type, m_writable, TYPE_BINARY, TYPE_DATE, TYPE_FILE, TYPE_NUM, TYPE_TEXT
 
Constructor Summary
WritableProperty(java.lang.String name)
          Constructor.
 
Method Summary
 void setDefaultValue(java.lang.Object val)
          Establish the default value for this document property.
 void setInputFormat(java.lang.String fmt)
          Establish the input (source) format specification for this document property.
 void setLength(int len)
          Establish the length of this document property.
 void setOutputFormat(java.lang.String fmt)
          Establish the output format specification for this document property.
 void setType(java.lang.String type)
          Establish the type of this document property.
 
Methods inherited from class tribble.repository.DocumentProperty
equals, getDefaultValue, getInputFormat, getLength, getName, getOutputFormat, getType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WritableProperty

public WritableProperty(java.lang.String name)
Constructor.

Parameters:
name - The name of this document property. This cannot be null or empty.
Throws:
java.lang.NullPointerException - (unchecked) Thrown if name is null.
java.lang.IllegalArgumentException - (unchecked) Thrown if name is an empty string ("").
Since:
API 2.0, 2008-04-04
Method Detail

setType

public void setType(java.lang.String type)
Establish the type of this document property.

Overrides:
setType in class DocumentProperty
Parameters:
type - 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-04

setLength

public void setLength(int len)
Establish the length of this document property.

Overrides:
setLength in class DocumentProperty
Parameters:
len - The length of this document property, or zero if it is not defined.
Since:
API 2.0, 2008-04-04

setOutputFormat

public void setOutputFormat(java.lang.String fmt)
Establish the output format specification for this document property.

Overrides:
setOutputFormat in class DocumentProperty
Parameters:
fmt - The formatting specification of this property, which specifies how the property value should be formatted when it is stored in a repository document; or null if it is not defined.
Since:
API 2.0, 2008-04-04

setInputFormat

public void setInputFormat(java.lang.String fmt)
Establish the input (source) format specification for this document property.

Overrides:
setInputFormat in class DocumentProperty
Parameters:
fmt - The source formatting specification of this property, which specifies the format of the property value before it is stored in a repository 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 repository); or null if it is not defined.
Since:
API 2.0, 2008-04-04

setDefaultValue

public void setDefaultValue(java.lang.Object val)
Establish the default value for this document property. If this method is not called, the default value is null.

Overrides:
setDefaultValue in class DocumentProperty
Parameters:
val - The default value to be used by this document property if it is not explicitly set to another value. This can be null.
Since:
API 2.0, 2008-04-04