Package com.sun.xml.xsom

Examples of com.sun.xml.xsom.XSAttributeDecl


                        xsType = element.getType();
                        isElement = true;
                    }
                } else if (f.getPropertyInfo().getSchemaComponent() instanceof XSAttributeUse) {
                    XSAttributeUse attributeUse = (XSAttributeUse)f.getPropertyInfo().getSchemaComponent();
                    XSAttributeDecl decl = attributeUse.getDecl();
                    xmlDefaultValue = decl.getDefaultValue();                       
                    xsType = decl.getType();
                    isRequiredAttr = attributeUse.isRequired();
                }

               
                if (xsType != null && xsType.isComplexType() && containsDefaultValue(outline, f)) {
View Full Code Here


                        xsType = element.getType();
                        isElement = true;
                    }
                } else if (f.getPropertyInfo().getSchemaComponent() instanceof XSAttributeUse) {
                    XSAttributeUse attributeUse = (XSAttributeUse)f.getPropertyInfo().getSchemaComponent();
                    XSAttributeDecl decl = attributeUse.getDecl();
                    xmlDefaultValue = decl.getDefaultValue();                       
                    xsType = decl.getType();
                    isRequiredAttr = attributeUse.isRequired();
                }

               
                if (xsType != null && xsType.isComplexType() && containsDefaultValue(outline, f)) {
View Full Code Here

                        xsType = element.getType();
                        isElement = true;
                    }
                } else if (f.getPropertyInfo().getSchemaComponent() instanceof XSAttributeUse) {
                    XSAttributeUse attributeUse = (XSAttributeUse)f.getPropertyInfo().getSchemaComponent();
                    XSAttributeDecl decl = attributeUse.getDecl();
                    xmlDefaultValue = decl.getDefaultValue();                       
                    xsType = decl.getType();
                }

                if (null == xmlDefaultValue || null == xmlDefaultValue.value) {
                    continue;
                }
View Full Code Here

                return conv.getTypeUse(type);
            }
            detectJavaTypeCustomization();
        } else
        if( top instanceof XSAttributeDecl ) {
            XSAttributeDecl aref = (XSAttributeDecl)top;
            assert aref.getType()==type;
            detectJavaTypeCustomization();
        } else
        if( top instanceof XSComplexType ) {
            XSComplexType tref = (XSComplexType)top;
            assert tref.getBaseType()==type || tref.getContentType()==type;
View Full Code Here

   public void attributeDecl(XSAttributeDecl decl) {
      // visitAttribute(decl);
   }

   public void attributeUse(XSAttributeUse use) {
      XSAttributeDecl decl = use.getDecl();

      if (decl.isLocal()) {
         // this is anonymous attribute use
         visitAttribute(decl);
      }
   }
View Full Code Here

   public void attributeDecl(XSAttributeDecl decl) {
      // visitAttribute(decl);
   }

   public void attributeUse(XSAttributeUse use) {
      XSAttributeDecl decl = use.getDecl();

      if (decl.isLocal()) {
         // this is anonymous attribute use
         visitAttribute(decl);
      }
   }
View Full Code Here

                        xsType = element.getType();
                        isElement = true;
                    }
                } else if (f.getPropertyInfo().getSchemaComponent() instanceof XSAttributeUse) {
                    XSAttributeUse attributeUse = (XSAttributeUse)f.getPropertyInfo().getSchemaComponent();
                    XSAttributeDecl decl = attributeUse.getDecl();
                    xmlDefaultValue = decl.getDefaultValue();                       
                    xsType = decl.getType();
                }

               
                if (xsType != null && xsType.isComplexType() && containsDefaultValue(outline, f)) {
                    String varName = f.getPropertyInfo().getName(false);
View Full Code Here

                        xsType = element.getType();
                        isElement = true;
                    }
                } else if (f.getPropertyInfo().getSchemaComponent() instanceof XSAttributeUse) {
                    XSAttributeUse attributeUse = (XSAttributeUse)f.getPropertyInfo().getSchemaComponent();
                    XSAttributeDecl decl = attributeUse.getDecl();
                    xmlDefaultValue = decl.getDefaultValue();                       
                    xsType = decl.getType();
                }

                if (null == xmlDefaultValue || null == xmlDefaultValue.value) {
                    continue;
                }
View Full Code Here

    /* (non-Javadoc)
     * @see com.sun.xml.xsom.visitor.XSVisitor#attributeUse(com.sun.xml.xsom.XSAttributeUse)
     */
    public void attributeUse(XSAttributeUse use) {
        XSAttributeDecl decl = use.getDecl();

        String additionalAtts = "";

        if (use.isRequired()) {
            additionalAtts += " use=\"required\"";
        }
        if (use.getFixedValue() != null
                && use.getDecl().getFixedValue() == null) {
            additionalAtts += " fixed=\"" + use.getFixedValue() + "\"";
        }
        if (use.getDefaultValue() != null
                && use.getDecl().getDefaultValue() == null) {
            additionalAtts += " default=\"" + use.getDefaultValue() + "\"";
        }

        if (decl.isLocal()) {
            // this is anonymous attribute use
            dump(decl, additionalAtts);
        }
        else {
            // reference to a global one
            String str = MessageFormat.format(
                    "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{
                        decl.getTargetNamespace(), decl.getName(),
                        additionalAtts});
            SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
            this.currNode.add(newNode);
        }
    }
View Full Code Here

    public void dumpRef( XSAttGroupDecl decl ) {
        println(MessageFormat.format("<attGroup ref=\"'{'{0}'}'{1}\"/>", decl.getTargetNamespace(), decl.getName()));
    }

    public void attributeUse( XSAttributeUse use ) {
        XSAttributeDecl decl = use.getDecl();

        String additionalAtts="";

        if(use.isRequired())
            additionalAtts += " use=\"required\"";
        if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null)
            additionalAtts += " fixed=\""+use.getFixedValue()+'\"';
        if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null)
            additionalAtts += " default=\""+use.getDefaultValue()+'\"';

        if(decl.isLocal()) {
            // this is anonymous attribute use
            dump(decl,additionalAtts);
        } else {
            // reference to a global one
            println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>",
                decl.getTargetNamespace(), decl.getName(), additionalAtts));
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.xsom.XSAttributeDecl

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.