private void dumpComplexTypeAttribute( XSComplexType type ) { Iterator itr; itr = type.iterateAttGroups(); while(itr.hasNext()) dumpRef( (XSAttGroupDecl)itr.next() ); itr = type.iterateDeclaredAttributeUses(); while(itr.hasNext()) attributeUse( (XSAttributeUse)itr.next() ); XSWildcard awc = type.getAttributeWildcard(); if(awc!=null) wildcard("anyAttribute",awc,""); }
public void attributeDecl( XSAttributeDecl decl ) { dump(decl,""); }
public void elementDecl( XSElementDecl decl ) { elementDecl(decl,""); } private void elementDecl( XSElementDecl decl, String extraAtts ) {
public void attGroupDecl( XSAttGroupDecl decl ) { Iterator itr; println(MessageFormat.format("<attGroup name=\"{0}\">", decl.getName())); indent++; // TODO: wildcard itr = decl.iterateAttGroups(); while(itr.hasNext()) dumpRef( (XSAttGroupDecl)itr.next() ); itr = decl.iterateDeclaredAttributeUses(); while(itr.hasNext()) attributeUse( (XSAttributeUse)itr.next() ); indent--; println("</attGroup>"); }
public void schema( XSSchema s ) { // QUICK HACK: don't print the built-in components if(s.getTargetNamespace().equals(Const.schemaNamespace)) return; println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace())); indent++; Iterator itr; itr = s.iterateAttGroupDecls(); while(itr.hasNext()) attGroupDecl( (XSAttGroupDecl)itr.next() ); itr = s.iterateAttributeDecls(); while(itr.hasNext()) attributeDecl( (XSAttributeDecl)itr.next() ); itr = s.iterateComplexTypes(); while(itr.hasNext()) complexType( (XSComplexType)itr.next() ); itr = s.iterateElementDecls(); while(itr.hasNext()) elementDecl( (XSElementDecl)itr.next() ); itr = s.iterateModelGroupDecls(); while(itr.hasNext()) modelGroupDecl( (XSModelGroupDecl)itr.next() ); itr = s.iterateSimpleTypes(); while(itr.hasNext()) simpleType( (XSSimpleType)itr.next() ); indent--; println("</schema>"); }
public void restrictionSimpleType( XSRestrictionSimpleType type ) { if(type.getBaseType()==null) { // don't print anySimpleType if(!type.getName().equals("anySimpleType")) throw new InternalError(); if(!Const.schemaNamespace.equals(type.getTargetNamespace())) throw new InternalError(); return; } XSSimpleType baseType = type.getSimpleBaseType(); println(MessageFormat.format("<restriction{0}>", baseType.isLocal()?"":" base=\"{"+ baseType.getTargetNamespace()+'}'+ baseType.getName()+'\"')); indent++; if(baseType.isLocal()) simpleType(baseType); Iterator itr = type.iterateDeclaredFacets(); while(itr.hasNext()) facet( (XSFacet)itr.next() ); indent--; println("</restriction>"); }
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)); } }
public void complexType( XSComplexType type ) { println(MessageFormat.format("<complexType{0}>", type.isLocal()?"":" name=\""+type.getName()+'\"')); indent++; println("<simpleContent>"); indent++; println(MessageFormat.format("<restriction base=\"<{0}>{1}\">", baseType.getTargetNamespace(), baseType.getName())); indent++; dumpComplexTypeAttribute(type); println("</restriction>"); } else { println(MessageFormat.format("<extension base=\"<{0}>{1}\">", baseType.getTargetNamespace(), baseType.getName())); && type.getName().equals(baseType.getName())) { indent++; println("<redefine>"); indent++; baseType.visit(this); indent--; println("</redefine>"); indent--; dumpComplexTypeAttribute(type);
SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>");
public void schema( XSSchema s ) { // QUICK HACK: don't print the built-in components if(s.getTargetNamespace().equals(Const.schemaNamespace)) return; println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace())); indent++; Iterator itr; itr = s.iterateAttGroupDecls(); while(itr.hasNext()) attGroupDecl( (XSAttGroupDecl)itr.next() ); itr = s.iterateAttributeDecls(); while(itr.hasNext()) attributeDecl( (XSAttributeDecl)itr.next() ); itr = s.iterateComplexTypes(); while(itr.hasNext()) complexType( (XSComplexType)itr.next() ); itr = s.iterateElementDecls(); while(itr.hasNext()) elementDecl( (XSElementDecl)itr.next() ); itr = s.iterateModelGroupDecls(); while(itr.hasNext()) modelGroupDecl( (XSModelGroupDecl)itr.next() ); itr = s.iterateSimpleTypes(); while(itr.hasNext()) simpleType( (XSSimpleType)itr.next() ); indent--; println("</schema>"); }
public void attGroupDecl( XSAttGroupDecl decl ) { Iterator itr; println(MessageFormat.format("<attGroup name=\"{0}\">", decl.getName())); indent++; // TODO: wildcard itr = decl.iterateAttGroups(); while(itr.hasNext()) dumpRef( (XSAttGroupDecl)itr.next() ); itr = decl.iterateDeclaredAttributeUses(); while(itr.hasNext()) attributeUse( (XSAttributeUse)itr.next() ); indent--; println("</attGroup>"); }
public void restrictionSimpleType( XSRestrictionSimpleType type ) { if(type.getBaseType()==null) { // don't print anySimpleType if(!type.getName().equals("anySimpleType")) throw new InternalError(); if(!Const.schemaNamespace.equals(type.getTargetNamespace())) throw new InternalError(); return; } XSSimpleType baseType = type.getSimpleBaseType(); println(MessageFormat.format("<restriction{0}>", baseType.isLocal()?"":" base=\"{"+ baseType.getTargetNamespace()+'}'+ baseType.getName()+'\"')); indent++; if(baseType.isLocal()) simpleType(baseType); Iterator itr = type.iterateDeclaredFacets(); while(itr.hasNext()) facet( (XSFacet)itr.next() ); indent--; println("</restriction>"); }
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)); } }
public void complexType( XSComplexType type ) { println(MessageFormat.format("<complexType{0}>", type.isLocal()?"":" name=\""+type.getName()+'\"')); indent++; println("<simpleContent>"); indent++; println(MessageFormat.format("<restriction base=\"<{0}>{1}\">", baseType.getTargetNamespace(), baseType.getName())); indent++; dumpComplexTypeAttribute(type); println("</restriction>"); } else { println(MessageFormat.format("<extension base=\"<{0}>{1}\">", baseType.getTargetNamespace(), baseType.getName())); && type.getName().equals(baseType.getName())) { indent++; println("<redefine>"); indent++; baseType.visit(this); indent--; println("</redefine>"); indent--; dumpComplexTypeAttribute(type);
SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>");
public void schema( XSSchema s ) { // QUICK HACK: don't print the built-in components if(s.getTargetNamespace().equals(Const.schemaNamespace)) return; println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace())); indent++; Iterator itr; itr = s.iterateAttGroupDecls(); while(itr.hasNext()) attGroupDecl( (XSAttGroupDecl)itr.next() ); itr = s.iterateAttributeDecls(); while(itr.hasNext()) attributeDecl( (XSAttributeDecl)itr.next() ); itr = s.iterateComplexTypes(); while(itr.hasNext()) complexType( (XSComplexType)itr.next() ); itr = s.iterateElementDecls(); while(itr.hasNext()) elementDecl( (XSElementDecl)itr.next() ); itr = s.iterateModelGroupDecls(); while(itr.hasNext()) modelGroupDecl( (XSModelGroupDecl)itr.next() ); itr = s.iterateSimpleTypes(); while(itr.hasNext()) simpleType( (XSSimpleType)itr.next() ); indent--; println("</schema>"); }
private void dumpComplexTypeAttribute( XSComplexType type ) { Iterator itr; itr = type.iterateAttGroups(); while(itr.hasNext()) dumpRef( (XSAttGroupDecl)itr.next() ); itr = type.iterateDeclaredAttributeUses(); while(itr.hasNext()) attributeUse( (XSAttributeUse)itr.next() ); XSWildcard awc = type.getAttributeWildcard(); if(awc!=null) wildcard("anyAttribute",awc,""); }
public void attGroupDecl( XSAttGroupDecl decl ) { Iterator itr; println(MessageFormat.format("<attGroup name=\"{0}\">", decl.getName())); indent++; // TODO: wildcard itr = decl.iterateAttGroups(); while(itr.hasNext()) dumpRef( (XSAttGroupDecl)itr.next() ); itr = decl.iterateDeclaredAttributeUses(); while(itr.hasNext()) attributeUse( (XSAttributeUse)itr.next() ); indent--; println("</attGroup>"); }
public void restrictionSimpleType( XSRestrictionSimpleType type ) { if(type.getBaseType()==null) { // don't print anySimpleType if(!type.getName().equals("anySimpleType")) throw new InternalError(); if(!Const.schemaNamespace.equals(type.getTargetNamespace())) throw new InternalError(); return; } XSSimpleType baseType = type.getSimpleBaseType(); println(MessageFormat.format("<restriction{0}>", baseType.isLocal()?"":" base=\"{"+ baseType.getTargetNamespace()+'}'+ baseType.getName()+'\"')); indent++; if(baseType.isLocal()) simpleType(baseType); Iterator itr = type.iterateDeclaredFacets(); while(itr.hasNext()) facet( (XSFacet)itr.next() ); indent--; println("</restriction>"); }
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)); } }