|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.elca.el4j.util.metadata.MetaDataCollector
public class MetaDataCollector
Depending to the used kind of metadata, it can be defined on a field, on a method, on a class, and on a package. The used kinds of metadata are the Commons Attributes and the Java 5 Annotations. Both can handle metadata defined on a field, on a method, and on a class.
This class collects metadata from different classes. The examples below show you how the metadata is collected.
public interface X { public int getValue(); } public interface Y { public int getValue(); } public class A implements X { public int getValue() {...} } public class B extends A implements Y { public int getValue() {...} } public class C extends B { public int getValue() {...} }
If metadata for method getValue()
of Class C
is
requested, the result will be a collection of metadata from class
C
and interfaces Y
and X
. Metadata
defined in class A
and B
will be omitted.
The same behavior can be found with metadata on class level. The collection
of metadata will also only contain metadata defined on class C
and interfaces Y
and X
.
Always the most specific implementation and all interfaces will be inspected.
Constructor Summary | |
---|---|
MetaDataCollector()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
Collection |
getAttributes(Class targetClass)
Return the class attributes of the target class. |
Collection |
getAttributes(Class targetClass,
Class filter)
Return the class attributes of the target class of a given type. |
Collection |
getAttributes(Field targetField)
Directly calls the metadata delegator. |
Collection |
getAttributes(Field targetField,
Class filter)
Directly calls the metadata delegator. |
Collection |
getAttributes(Method targetMethod)
Return the method attributes of the target method. |
Collection |
getAttributes(Method targetMethod,
Class filter)
Return the method attributes of the target method of a given type. |
Attributes |
getMetaDataDelegator()
|
void |
setMetaDataDelegator(Attributes metaDataDelegator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaDataCollector()
Method Detail |
---|
public Attributes getMetaDataDelegator()
public void setMetaDataDelegator(Attributes metaDataDelegator)
metaDataDelegator
- Is the metaDataDelegator to set.public Collection getAttributes(Class targetClass)
getAttributes
in interface Attributes
targetClass
- the class that contains attribute information
null
public Collection getAttributes(Class targetClass, Class filter)
The class attributes are filtered by providing a Class
reference to indicate the type to filter on. This is useful if you know
the type of the attribute you are looking for and don't want to sort
through the unfiltered Collection yourself.
getAttributes
in interface Attributes
targetClass
- the class that contains attribute informationfilter
- specify that only this type of class should be returned
public Collection getAttributes(Method targetMethod)
getAttributes
in interface Attributes
targetMethod
- the method that contains attribute information
null
public Collection getAttributes(Method targetMethod, Class filter)
The method attributes are filtered by providing a Class
reference to indicate the type to filter on. This is useful if you know
the type of the attribute you are looking for and don't want to sort
through the unfiltered Collection yourself.
getAttributes
in interface Attributes
targetMethod
- the method that contains attribute informationfilter
- specify that only this type of class should be returned
null
public Collection getAttributes(Field targetField)
getAttributes
in interface Attributes
targetField
- the field that contains attribute information
null
public Collection getAttributes(Field targetField, Class filter)
The field attributes are filtered by providing a Class
reference to indicate the type to filter on. This is useful if you know
the type of the attribute you are looking for and don't want to sort
through the unfiltered Collection yourself.
getAttributes
in interface Attributes
targetField
- the field that contains attribute informationfilter
- specify that only this type of class should be returned
null
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |