Package com.codingcrayons.aspectfaces.annotation.registration

Examples of com.codingcrayons.aspectfaces.annotation.registration.AnnotationDescriptor


        Class<AnnotationDescriptor> fieldDescriptorClass = (Class<AnnotationDescriptor>) clazz;

        try {
          StringBuilder builder = new StringBuilder();

          AnnotationDescriptor descriptor = fieldDescriptorClass.newInstance();
          AnnotationProvider provider = new AnnotationProvider("Dummy");

          String currentPackageName = descriptor.getAnnotationName().substring(0,
            descriptor.getAnnotationName().lastIndexOf("."));
          if (!packageName.equals(currentPackageName)) {
            packageName = currentPackageName;
            builder.append('\n');
            builder.append(currentPackageName).append('\n');
            builder.append('\n');
          }

          List<Variable> vars = new ArrayList<Variable>();
          if (descriptor instanceof VariableJoinPoint) {
            vars = ((VariableJoinPoint) descriptor).getVariables(provider);
          }
          String evalValue = "";
          if (descriptor instanceof EvaluableJoinPoint) {
            evalValue = ((EvaluableJoinPoint) descriptor).getEvaluableValue(provider);
          }
          String order = "";
          if (descriptor instanceof OrderJoinPoint) {
            order = "order";
          }
          String role = "";
          if (descriptor instanceof SecurityJoinPoint) {
            role = "roles";
          }
          builder.append("@").append(descriptor.getAnnotationName().substring(descriptor.getAnnotationName().lastIndexOf(".") + 1)).append(':');
          builder.append(fieldDescriptorClass.getSimpleName()).append(':');
          if (!vars.isEmpty()) {
            builder.append("variables=");
            for (int i = 0; i < vars.size(); ++i) {
              builder.append("").append(vars.get(i).getName());
              if (i < vars.size() - 1) {
                builder.append(",");
              }
            }
            builder.append(':');
          } else {
            builder.append(':');
          }
          if (evalValue != null && !evalValue.isEmpty()) {
            builder.append("evaluable variables=").append(evalValue).append(':');
          } else {
            builder.append(':');
          }
          if (order != null && !order.isEmpty()) {
            builder.append("order=").append(order).append(':');
          } else {
            builder.append(':');
          }
          if (role != null && !role.isEmpty()) {
            builder.append("roles=").append(role).append(':');
          } else {
            builder.append(':');
          }
          if (FULL) {
            builder.append(descriptor.getAnnotationName()).append(':');
            builder.append(fieldDescriptorClass.getName()).append(':');
          }
          builder.append('\n');
          LOGGER.trace(builder.toString());
        } catch (InstantiationException e) {
View Full Code Here

TOP

Related Classes of com.codingcrayons.aspectfaces.annotation.registration.AnnotationDescriptor

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.