C# Class SimpleFramework.Xml.Core.AnnotationHandler

The AnnotationHandler object is used to handle all invocation made on a synthetic annotation. This is required so that annotations can be created without an implementation. The java.lang.reflect.Proxy object is used to wrap this invocation handler with the annotation interface.
Inheritance: InvocationHandler
Datei anzeigen Open project: ngallagher/simplexml

Public Methods

Method Description
AnnotationHandler ( Class type ) : System

Constructor for the AnnotationHandler object. This is used to create a handler for invocations on a synthetic annotation. The annotation type wrapped must be provided.

Attributes ( System.StringBuilder builder ) : void

This is used to build a string from the annotation. The string produces adheres to the typical string representation of a normal annotation. This ensures that an exceptions that are thrown with a string representation of the annotation are identical to those thrown with a normal annotation.

Equals ( Object proxy, Object list ) : bool

This is used to determine if two annotations are equals based on the attributes of the annotation. The comparison done can ignore specific attributes, for instance the name attribute.

Invoke ( Object proxy, Method method, Object list ) : Object

This is used to handle all invocations on the wrapped annotation. Typically the response to an invocation will result in the default value of the annotation attribute being returned. If the method is an equals or toString then this will be handled by an internal implementation.

Name ( System.StringBuilder builder ) : void

This is used to build a string from the annotation. The string produces adheres to the typical string representation of a normal annotation. This ensures that an exceptions that are thrown with a string representation of the annotation are identical to those thrown with a normal annotation.

ToString ( ) : String

This is used to build a string from the annotation. The string produces adheres to the typical string representation of a normal annotation. This ensures that an exceptions that are thrown with a string representation of the annotation are identical to those thrown with a normal annotation.

Value ( Method method ) : Object

This is used to extract the default value used for the provided annotation attribute. This will return the default value for all attributes except that it makes the requirement optional. Making the requirement optional provides better functionality.

Method Details

AnnotationHandler() public method

Constructor for the AnnotationHandler object. This is used to create a handler for invocations on a synthetic annotation. The annotation type wrapped must be provided.
public AnnotationHandler ( Class type ) : System
type Class /// this is the annotation type that this is wrapping ///
return System

Attributes() public method

This is used to build a string from the annotation. The string produces adheres to the typical string representation of a normal annotation. This ensures that an exceptions that are thrown with a string representation of the annotation are identical to those thrown with a normal annotation.
public Attributes ( System.StringBuilder builder ) : void
builder System.StringBuilder /// this is the builder used to compose the text ///
return void

Equals() public method

This is used to determine if two annotations are equals based on the attributes of the annotation. The comparison done can ignore specific attributes, for instance the name attribute.
public Equals ( Object proxy, Object list ) : bool
proxy Object /// this is the annotation the invocation was made on ///
list Object /// this is the parameters provided to the invocation ///
return bool

Invoke() public method

This is used to handle all invocations on the wrapped annotation. Typically the response to an invocation will result in the default value of the annotation attribute being returned. If the method is an equals or toString then this will be handled by an internal implementation.
public Invoke ( Object proxy, Method method, Object list ) : Object
proxy Object /// this is the proxy object the invocation was made on ///
method Method /// this is the method that was invoked on the proxy ///
list Object /// this is the list of parameters to be used ///
return Object

Name() public method

This is used to build a string from the annotation. The string produces adheres to the typical string representation of a normal annotation. This ensures that an exceptions that are thrown with a string representation of the annotation are identical to those thrown with a normal annotation.
public Name ( System.StringBuilder builder ) : void
builder System.StringBuilder /// this is the builder used to compose the text ///
return void

ToString() public method

This is used to build a string from the annotation. The string produces adheres to the typical string representation of a normal annotation. This ensures that an exceptions that are thrown with a string representation of the annotation are identical to those thrown with a normal annotation.
public ToString ( ) : String
return String

Value() public method

This is used to extract the default value used for the provided annotation attribute. This will return the default value for all attributes except that it makes the requirement optional. Making the requirement optional provides better functionality.
public Value ( Method method ) : Object
method Method /// this is the annotation representing the attribute ///
return Object