| org.compass.core.Resource
All known Subclasses: org.compass.core.converter.mapping.CollectionResourceWrapper,
Resource | public interface Resource extends AliasedObject,Serializable(Code) | | A Resource holds a list of meta data properties. The Resource is the basic
data that is saved in Compass. Compass provides object to Resource mapping as
well in the CompassSession object.
author: kimchy |
addProperty | Resource addProperty(String name, Object value) throws SearchEngineException(Code) | | Adds a property to the resource based on resource mapping definitions. If
the property already exists in the resource (the name exists), it will be
added on top of it (won't replace it). ONLY use this method with resource
mapping.
Parameters: name - the name of the property Parameters: value - the value to be set (will be converted to a string). throws: SearchEngineException - |
addProperty | Resource addProperty(String name, Reader value) throws SearchEngineException(Code) | | Adds a property to the resource based on resource mapping definitions. If
the property already exists in the resource (the name exists), it will be
added on top of it (won't replace it). ONLY use this method with resource
mapping.
Parameters: name - the name of the property Parameters: value - the value to be set (will be converted to a string). throws: SearchEngineException - |
addProperty | Resource addProperty(Property property)(Code) | | Add a property to the resource. If the property already exists in the
resource (the name exists), it will be added on top of it (won't replace
it). Note: Compass adds all properties specified in mapping file, adding
extra properties to a Resource will make the index out of sync with
mapping.
Parameters: property - The properyt to add |
copy | void copy(Resource resource)(Code) | | Copies the content of the give Resource into the current one
Parameters: resource - The resource to copy from |
getAlias | String getAlias()(Code) | | Returns the mapping alias of the associated Resource
The alias |
getBoost | float getBoost()(Code) | | Returns the boost for the property.
The boost value |
getId | String getId()(Code) | | Returns the id of the resource. Used when there is only one id
for the resource.
The id of the resource. |
getIdProperties | Property[] getIdProperties()(Code) | | Returns the id properties of the resource
The id properties of the resource |
getIdProperty | Property getIdProperty()(Code) | | Returns the id property of the resource
The id properties of the resource |
getIds | String[] getIds()(Code) | | Returns the id values of the resource.
The id values of the resource |
getObject | Object getObject(String name)(Code) | | Returns the object vlaue of the property with the given name if any exists
in the resource, or null. If multiple properties exists with this name,
this methods returns the first value added.
If a converter is associated with the property in one of Compass mapping definitions,
it will be used to convert the string value to an object value. If there is no converter
associated with the property, the string value will be returned.
Parameters: name - The name of the property The first object value that match the name (converted if possible) |
getProperties | Property[] getProperties(String name)(Code) | | Returns all the properties under the given name.
Parameters: name - The name of the properties An array of properties that match the name |
getProperties | Property[] getProperties()(Code) | | Returns all the properties for the resource.
All the properties |
getProperty | Property getProperty(String name)(Code) | | Returns the first property under the name.
Parameters: name - The name of the property The first proeprty that match the name |
getUID | String getUID() throws CompassException(Code) | | Returns the unique id of the resource. Note, the ids must be
set on this resource in order to get the uid, if not a
CompassException will be thrown.
|
getValue | String getValue(String name)(Code) | | Returns the string value of the property with the given name if any exist
in this resource, or null. If multiple properties exist with this name,
this method returns the first value added.
Parameters: name - The name of the property The first value that match the name |
getValues | String[] getValues(String name)(Code) | | Returns an array of values of the property specified as the method
parameter. This method can return null .
Parameters: name - the name of the property a String[] of property values |
removeProperties | Resource removeProperties(String name)(Code) | | Removes all the properties under the given name.
Parameters: name - The properties name to remove |
removeProperty | Resource removeProperty(String name)(Code) | | Remove the latest property added under the given name.
Parameters: name - The last property name to remove |
setBoost | Resource setBoost(float boost)(Code) | | Sets the boost level for the resource.
Parameters: boost - The boost level for the resource |
setProperty | Resource setProperty(String name, Object value) throws SearchEngineException(Code) | | Sets a property to the resource (removes then adds) based on resource mapping definitions. If
the property already exists in the resource (the name exists), it will be
added on top of it (won't replace it). ONLY use this method with resource
mapping.
Parameters: name - the name of the property Parameters: value - the value to be set (will be converted to a string). throws: SearchEngineException - |
setProperty | Resource setProperty(String name, Reader value) throws SearchEngineException(Code) | | Sets a property to the resource (removes then adds) based on resource mapping definitions. If
the property already exists in the resource (the name exists), it will be
added on top of it (won't replace it). ONLY use this method with resource
mapping.
Parameters: name - the name of the property Parameters: value - the value to be set (will be converted to a string). throws: SearchEngineException - |
setProperty | Resource setProperty(Property property)(Code) | | Sest a property to the resource (removes then adds). If the property already exists in the
resource (the name exists), it will be added on top of it (won't replace
it). Note: Compass adds all properties specified in mapping file, adding
extra properties to a Resource will make the index out of sync with
mapping.
Parameters: property - The properyt to add |
|
|