Package jodd.util

Class AnnotationParser.Reader

  • Enclosing class:
    AnnotationParser

    public class AnnotationParser.Reader
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
      Returns the annotation type this reader is for.
      boolean readBoolean​(java.lang.String name, boolean defaultValue)
      Reads boolean element from the annotation.
      java.lang.Object readElement​(java.lang.String name)
      Reads annotation element as an object.
      int readInt​(java.lang.String name, int defaultValue)
      Reads int element from the annotation.
      java.lang.String readString​(java.lang.String name, java.lang.String defaultValue)
      Reads string element from the annotation.
      protected java.lang.String readStringElement​(java.lang.String name)
      Reads non-empty, trimmed, annotation element value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • annotationType

        public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
        Returns the annotation type this reader is for.
      • readStringElement

        protected java.lang.String readStringElement​(java.lang.String name)
        Reads non-empty, trimmed, annotation element value. If annotation value is missing, it will read value from default annotation. If still missing, returns null.
      • readElement

        public java.lang.Object readElement​(java.lang.String name)
        Reads annotation element as an object. If annotation value is missing, it will be read from default annotation. If still missing, returns null.
      • readString

        public java.lang.String readString​(java.lang.String name,
                                           java.lang.String defaultValue)
        Reads string element from the annotation. Empty strings are detected and default value is returned instead.
      • readBoolean

        public boolean readBoolean​(java.lang.String name,
                                   boolean defaultValue)
        Reads boolean element from the annotation.
      • readInt

        public int readInt​(java.lang.String name,
                           int defaultValue)
        Reads int element from the annotation.