org.codehaus.annogen.generate
Class AnnoBeanMapping
java.lang.Object
org.codehaus.annogen.generate.AnnoBeanMapping
public class AnnoBeanMapping
- extends java.lang.Object
Encapsulates the delcaration of a one-to-one mapping of some set of
175 annotation types to their corresponding annotation beans. The mapping
is declared as a pair of strings, e.g.
typePattern = com.foo.MyAnnotation
beanPattern = com.foo.annobeans.MyAnnotationBean
This implementation also supports a simple wildcard substituion using '*',
e.g.
typePattern = com.foo.*Annotation
beanPattern = com.foo.annobeans.*AnnotationBean
The rule for matching is that a type matches if the type name startsWith
the part of the pattern before the *, and endsWith everything after the
*. Everything inbetween is substituted for the '*' in the beanPattern.
It is an error for only one fo the type and beanPatterns to contain
a *, or for either to contain more than one *.
- Author:
- Patrick Calahan <email: pcal-at-bea-dot-com>
Method Summary |
java.lang.String |
getAnnoBeanFor(java.lang.String classname)
If the annnotation type represented by the named class matches this
mapping's typePattern, returns the name of the annobean which it should
be mapped to. |
java.lang.String |
getBean()
|
java.lang.String |
getType()
|
void |
setBean(java.lang.String bean)
|
void |
setType(java.lang.String type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnoBeanMapping
public AnnoBeanMapping()
AnnoBeanMapping
public AnnoBeanMapping(java.lang.String typePattern,
java.lang.String beanPattern)
getAnnoBeanFor
public java.lang.String getAnnoBeanFor(java.lang.String classname)
- If the annnotation type represented by the named class matches this
mapping's typePattern, returns the name of the annobean which it should
be mapped to. If the type doesn't match, null is returned.
getType
public java.lang.String getType()
setType
public void setType(java.lang.String type)
getBean
public java.lang.String getBean()
setBean
public void setBean(java.lang.String bean)