|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.converter.mapping.CollectionResourceWrapper
public class CollectionResourceWrapper
A wrapper around a Resouce that allows for a marshalled collection to be read from it. Call
to getProperty(String) will return the first (or next) property that is registered
under that name. Calling getProperty(String) again will return the next one.
| Nested Class Summary | |
|---|---|
class |
CollectionResourceWrapper.PropertiesWrapper
|
| Constructor Summary | |
|---|---|
CollectionResourceWrapper(Resource resource)
|
|
| Method Summary | |
|---|---|
Resource |
addProperty(Property property)
Add a property to the resource. |
Resource |
addProperty(String name,
Object value)
Adds a property to the resource based on resource mapping definitions. |
Resource |
addProperty(String name,
Reader value)
Adds a property to the resource based on resource mapping definitions. |
void |
copy(Resource resource)
Copies the content of the give Resource into the current one |
String |
getAlias()
Returns the mapping alias of the associated Resource |
float |
getBoost()
Returns, at indexing time, the boost factor as set by Resource.setBoost(float). |
String |
getId()
Returns the id of the resource. |
Property[] |
getIdProperties()
Returns the id properties of the resource |
Property |
getIdProperty()
Returns the id property of the resource |
String[] |
getIds()
Returns the id values of the resource. |
Object |
getObject(String name)
Returns the object value of the property with the given name if any exists in the resource, or null. |
Object[] |
getObjects(String name)
Returns an array of values of the proeprty with the given name. |
Property[] |
getProperties()
Returns all the properties for the resource. |
Property[] |
getProperties(String name)
Returns all the properties under the given name. |
Property |
getProperty(String name)
Returns the first property under the name. |
String |
getUID()
Returns the unique id of the resource. |
String |
getValue(String name)
Returns the string value of the property with the given name if any exist in this resource, or null. |
String[] |
getValues(String name)
Returns an array of values of the property specified as the method parameter. |
Resource |
removeProperties(String name)
Removes all the properties under the given name. |
Resource |
removeProperty(String name)
Remove the latest property added under the given name. |
void |
rollbackGetProperty(String name)
|
Resource |
setBoost(float boost)
/** Sets a boost factor for hits on any field of this document. |
Resource |
setProperty(Property property)
Sest a property to the resource (removes then adds). |
Resource |
setProperty(String name,
Object value)
Sets a property to the resource (removes then adds) based on resource mapping definitions. |
Resource |
setProperty(String name,
Reader value)
Sets a property to the resource (removes then adds) based on resource mapping definitions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionResourceWrapper(Resource resource)
| Method Detail |
|---|
public String getValue(String name)
Resource
getValue in interface Resourcename - The name of the property
public Object getObject(String name)
ResourceIf 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.
getObject in interface Resourcename - The name of the property
public String[] getValues(String name)
Resourcenull.
getValues in interface Resourcename - the name of the property
String[] of property valuespublic String getAlias()
Resource
getAlias in interface ResourcegetAlias in interface AliasedObjectpublic String getId()
Resource
getId in interface Resourcepublic String getUID()
ResourceCompassException will be thrown.
getUID in interface Resourcepublic String[] getIds()
Resource
getIds in interface Resourcepublic Property getIdProperty()
Resource
getIdProperty in interface Resourcepublic Property[] getIdProperties()
Resource
getIdProperties in interface Resource
public Resource addProperty(String name,
Object value)
throws SearchEngineException
Resource
addProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineException
public Resource addProperty(String name,
Reader value)
throws SearchEngineException
Resource
addProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineExceptionpublic Resource addProperty(Property property)
Resource
addProperty in interface Resourceproperty - The properyt to addpublic Resource removeProperty(String name)
Resource
removeProperty in interface Resourcename - The last property name to removepublic Resource removeProperties(String name)
Resource
removeProperties in interface Resourcename - The properties name to remove
public Resource setProperty(String name,
Object value)
throws SearchEngineException
Resource
setProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineException
public Resource setProperty(String name,
Reader value)
throws SearchEngineException
Resource
setProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineExceptionpublic Resource setProperty(Property property)
Resource
setProperty in interface Resourceproperty - The properyt to addpublic Property getProperty(String name)
Resource
getProperty in interface Resourcename - The name of the property
public void rollbackGetProperty(String name)
public Property[] getProperties(String name)
Resource
getProperties in interface Resourcename - The name of the properties
public Object[] getObjects(String name)
ResourceIf 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.
getObjects in interface Resourcepublic Property[] getProperties()
Resource
getProperties in interface Resourcepublic float getBoost()
ResourceResource.setBoost(float).
Note that once a document is indexed this value is no longer available
from the index. At search time, for retrieved documents, this method always
returns 1. This however does not mean that the boost value set at indexing
time was ignored - it was just combined with other indexing time factors and
stored elsewhere, for better indexing and search performance. (For more
information see the "norm(t,d)" part of the scoring formula in
Similarity.)
getBoost in interface Resourcepublic Resource setBoost(float boost)
ResourceThe default value is 1.0.
Values are multiplied into the value of Property.getBoost() of
each properties of the resource. Thus, this method in effect sets a default
boost for the fields of this document.
setBoost in interface Resourceboost - The boost level for the resourceProperty.setBoost(float)public void copy(Resource resource)
Resource
copy in interface Resourceresource - The resource to copy from
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||