Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.aspectwerkz.annotation.expression
Class AnnotationVisitor

    java.lang.Object
      org.codehaus.aspectwerkz.annotation.expression.AnnotationVisitor

All Implemented Interfaces:
  AnnotationParserVisitor

    public class AnnotationVisitor

extends Object
implements AnnotationParserVisitor

Parse a source-like annotation representation to feed a map of AnnotationElement which contain holder to actual values. Class and type referenced are holded behind lazy wrapper that won't load them unless used.

Note that this parser will trigger class loading to ensure type consistency [change to ASMClassInfo instead of reflect if embedded parsing needed]

Note: the loader used here is the one from the annotation class and not the one from annotated element That does not matter since parse time is a build time operation for now.

Author:
  Jonas Bonér , Alexandre Vasseur

Field Summary
`protected Class` | `m_annotationClass` We reference class at parse time.
`protected Map` | `m_annotationElementValueHoldersByName`
`protected static AnnotationParser` | `PARSER` The one and only annotation parser.

Constructor Summary
`AnnotationVisitor(Map annotationElementValueHoldersByName, Class annotationClass)` Creates a new visitor.

Method Summary
`static void` | `parse(Map annotationElements, String annotationRepresentation, Class annotationClass)` Parse the given annotationRepresentation (@XXX(...)) to feed the given annotationElements map, based on the annotationClass annotation interface.
`Object` | `visit(ASTAnnotation node, Object data)`
`Object` | `visit(ASTArray node, Object data)`
`Object` | `visit(ASTBoolean node, Object data)`
`Object` | `visit(ASTChar node, Object data)`
`Object` | `visit(ASTFloat node, Object data)`
`Object` | `visit(ASTHex node, Object data)`
`Object` | `visit(ASTIdentifier node, Object data)`
`Object` | `visit(ASTInteger node, Object data)`
`Object` | `visit(ASTKeyValuePair node, Object data)`
`Object` | `visit(ASTOct node, Object data)`
`Object` | `visit(ASTRoot node, Object data)`
`Object` | `visit(ASTString node, Object data)`
`Object` | `visit(SimpleNode node, Object data)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PARSER

    protected static final AnnotationParser PARSER

  The one and only annotation parser.

### m_annotationElementValueHoldersByName

    protected Map m_annotationElementValueHoldersByName

### m_annotationClass

    protected Class m_annotationClass

  We reference class at parse time. We don't need to avoid reflection.

Constructor Detail

### AnnotationVisitor

    public AnnotationVisitor(Map annotationElementValueHoldersByName,
                             Class annotationClass)

  Creates a new visitor.

Method Detail

### parse

    public static void parse(Map annotationElements,
                             String annotationRepresentation,
                             Class annotationClass)

  Parse the given annotationRepresentation (@XXX(...)) to feed the given annotationElements map, based on the annotationClass annotation interface.

  Parameters:
    `annotationElements` -
    `annotationRepresentation` -
    `annotationClass` -

### visit

    public Object visit(SimpleNode node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTRoot node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTAnnotation node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTKeyValuePair node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTArray node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTIdentifier node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTBoolean node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTChar node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTString node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTInteger node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTFloat node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTHex node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

### visit

    public Object visit(ASTOct node,
                        Object data)

  Specified by:
    `visit` in interface `AnnotationParserVisitor`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.