Package net.sourceforge.javautil.groovy.builder.interceptor.annotation

Examples of net.sourceforge.javautil.groovy.builder.interceptor.annotation.Node


   */
  public PackageInstantiator(Class... classes) {
    this(getPackageNames(classes));
   
    for (Class<?> clazz : classes) {
      Node node = clazz.getAnnotation(Node.class);
      if (node != null && node.aliases().length > 0) {
        for (Alias alias : node.aliases()) {
          this.aliases.put(alias.name(), alias.type());
        }
      }
    }
  }
View Full Code Here


   * specify which method should be used, if any, to set the parent to child node.
   */
  public void associate(GroovyBuilder builder, ObjectFactoryInterceptor ofi, Object child, Object parent) {
    Node.Type type = null;
    boolean parentRequired = true;
    Node cnode = child.getClass().getAnnotation(Node.class);
   
    if (cnode != null) {
      type = cnode.value();
      parentRequired = cnode.parentRequired();
    } else {
      ClassMethod method = this.getTypeIndicator(child.getClass());
      if (method != null) {
        cnode = method.getAnnotation(Node.class);
        parentRequired = cnode.parentRequired();
        type = (Node.Type) method.invoke(child);
      } else {
        type = Node.Type.Branch;
        parentRequired = false;
      }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.groovy.builder.interceptor.annotation.Node

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.