Class Attribute
Base class for Attributes that can be added to a AttributeSource.
Attributes are used to add data in a dynamic, yet type-safe way to a source of usually streamed objects, e. g. a TokenStream.
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public abstract class Attribute : object, IAttribute
Methods
Name | Description |
---|---|
Clear() | Clears the values in this Attribute and resets it to its default value. If this implementation implements more than one Attribute interface it clears all. |
Clone() | Shallow clone. Subclasses must override this if they need to clone any members deeply, |
CopyTo(IAttribute) | Copies the values from this Attribute into the passed-in
|
ReflectAsString(Boolean) | This method returns the current attribute values as a string in the following format by calling the ReflectWith(IAttributeReflector) method:
|
ReflectWith(IAttributeReflector) | This method is for introspection of attributes, it should simply add the key/values this attribute holds to the given IAttributeReflector. The default implementation calls Reflect(Type, String, Object) for all non-static fields from the implementing class, using the field name as key and the field value as value. The IAttribute class is also determined by Reflection. Please note that the default implementation can only handle single-Attribute implementations. Custom implementations look like this (e.g. for a combined attribute implementation):
If you implement this method, make sure that for each invocation, the same set of IAttribute
interfaces and keys are passed to Reflect(Type, String, Object) in the same order, but possibly
different values. So don't automatically exclude e.g. |
ToString() | The default implementation of this method accesses all declared fields of this object and prints the values in the following syntax:
This method may be overridden by subclasses. |