Examples of DecoratedMethodDeclaration


Examples of net.sf.jelly.apt.decorations.declaration.DecoratedMethodDeclaration

          //if the property has an explicit annotation, we'll include it.
          return true;
        }
      }

      DecoratedMethodDeclaration getter = property.getGetter();
      if (getter == null) {
        //needs a getter.
        return false;
      }

      DecoratedMethodDeclaration setter = property.getSetter();
      if (setter == null) {
        //needs a setter.
        return false;
      }

      if (!getter.getModifiers().contains(Modifier.PUBLIC)) {
        //we only have to worry about public methods ("properties" are only defined by public accessor methods).
        return false;
      }

      if (!setter.getModifiers().contains(Modifier.PUBLIC)) {
        //we only have to worry about public methods ("properties" are only defined by public accessor methods).
        return false;
      }

      return (((accessType != XmlAccessType.NONE) && (accessType != XmlAccessType.FIELD)) || (explicitlyDeclaredAccessor(declaration)));
View Full Code Here

Examples of net.sf.jelly.apt.decorations.declaration.DecoratedMethodDeclaration

  public ValidationResult validateAccessor(Accessor accessor) {
    ValidationResult result = new ValidationResult();

    if (accessor.getDelegate() instanceof PropertyDeclaration) {
      PropertyDeclaration property = (PropertyDeclaration) accessor.getDelegate();
      DecoratedMethodDeclaration getter = property.getGetter();
      DecoratedMethodDeclaration setter = property.getSetter();

      if ((getter != null) && (setter != null)) {
        //find all JAXB annotations that are on both the setter and the getter...
        Map<String, AnnotationMirror> getterAnnotations = getter.getAnnotations();
        Map<String, AnnotationMirror> setterAnnotations = setter.getAnnotations();
        for (String annotation : getterAnnotations.keySet()) {
          if ((annotation.startsWith(XmlElement.class.getPackage().getName())) && (setterAnnotations.containsKey(annotation))) {
            result.addError(setter, "'" + annotation + "' is on both the getter and setter.");
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.