Package org.jboss.forge.roaster.model.source

Examples of org.jboss.forge.roaster.model.source.AnnotationTargetSource


      Result result;

      if (onProperty.hasValue())
      {
         String propertyName = onProperty.getValue().getUnderlyingResourceObject().getName();
         AnnotationTargetSource field = javaSource.getField(propertyName);

         addAnnotationToSource(field, annotation.getValue());

         result = Results.success("Annotation \"" + annotation.getValue() + "\" was successfully added to \""
                  + propertyName + "\" property declaration.");
      }
      else if (onMethod.hasValue())
      {
         List<Parameter> parameters = onMethod.getValue().getUnderlyingResourceObject().getParameters();

         String[] stringParametersArray = new String[parameters.size()];

         for (int i = 0; i < parameters.size(); i++)
         {
            stringParametersArray[i] = parameters.get(i).getType().getName();
         }

         String methodName = onMethod.getValue().getUnderlyingResourceObject().getName();
         AnnotationTargetSource method = javaSource.getMethod(methodName, stringParametersArray);

         addAnnotationToSource(method, annotation.getValue());

         result = Results.success("Annotation \"" + annotation.getValue() + "\" was successfully added to the \""
                  + methodName + "\" method declaration.");
View Full Code Here

TOP

Related Classes of org.jboss.forge.roaster.model.source.AnnotationTargetSource

Copyright © 2018 www.massapicom. 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.