Package net.sourceforge.javautil.common.xml.annotation

Examples of net.sourceforge.javautil.common.xml.annotation.XmlTag


    this.propertyName = parent == null ? clazz.getSimpleName() : parent.propertyName;
    this.propertyType = clazz;
    this.classRegistry = tagDef != null && tagDef.classRegistry().length > 0 ? tagDef.classRegistry()[0] : null;
   
    if (tagDef == null || (tagDef != null && "".equals(tagDef.name()))) {
      XmlTag tag = null;
      Class<?> c = clazz.getSuperclass();
      while (tag == null && c != null) {
        tag = c.getAnnotation(XmlTag.class);
        if (tag != null && !"".equals(tag.name())) {
          if (tagDef == null) tagDef = tag;
          tagName = tag.name(); break;
        }
        c = c.getSuperclass();
      }
    }
View Full Code Here


//      if (tagDef.translation().length > 0) {
//        XMLTranslationGuide guide = ClassCache.getFor( tagDef.translation()[0].value() ).newInstance();
//        guide.
//      }
     
      XmlTag typeDef = null;
      if (tagType.getAnnotation(XmlTag.class) != null) typeDef = tagType.getAnnotation(XmlTag.class);
     
      if (tagDef.collection().length > 0) {
        this.collection = tagDef.collection()[0];
        this.collectionType = this.collection.type();
        this.tagType = this.collection.value();
       
        if (this.collectionType != CollectionType.WRAPPED)
          typeDef = this.collection.value().getAnnotation(XmlTag.class);
      }
      else if (tagDef.map().length > 0) {
        this.map = tagDef.map()[0];
        this.collectionType = this.map.type();
       
        if (this.collectionType != CollectionType.WRAPPED)
          typeDef = (XmlTag) this.map.valueClass().getAnnotation(XmlTag.class);
        else
          this.tagType = tagDef.concreteType() == Object.class ? LinkedHashMap.class : this.tagDef.concreteType();
      } else {
        if (this.elementType == ElementType.Unspecified)
          this.elementType = tagDef.elementType() == ElementType.Unspecified && typeDef != null ? typeDef.elementType() : tagDef.elementType();
      }
      this.tagName = "".equals( tagDef.name() ) && typeDef != null ? typeDef.name() : tagDef.name();
      if ("".equals(tagName)) tagName = property.getName();
     
      this.tagNamespace = "".equals( tagDef.namespace() ) && typeDef != null ? typeDef.namespace() : tagDef.namespace();
      this.classRegistry = tagDef.classRegistry().length > 0 ? tagDef.classRegistry()[0] :
        (typeDef != null && typeDef.classRegistry().length > 0 ? typeDef.classRegistry()[0] : null);
     
      if (this.elementType == ElementType.Unspecified) {
        if (XMLUtil.isSimpleType(this.tagType)) {
          this.elementType = ElementType.Simple;
        } else {
View Full Code Here

    String path = null;
    WebApplicationAuxilaryDescriptorLocation waadl = type.getAnnotation(WebApplicationAuxilaryDescriptorLocation.class);
    if (waadl != null) {
      path = waadl.relativeLocation();
    } else {
      XmlTag tag = type.getAnnotation(XmlTag.class);
      if (tag != null && !"".equals(tag.name())) {
        path = "WEB-INF/" + tag.name() + ".xml";
      } else {
        path = "WEB-INF/" + type.getSimpleName() + ".xml";
      }
    }
    return this.getAuxilaryDescriptor(path, type);
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.common.xml.annotation.XmlTag

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.