public void schema(XSSchema s) { // QUICK HACK: don't print the built-in components if (s.getTargetNamespace().equals(Const.schemaNamespace)) { return; } SchemaTreeNode newNode = new SchemaTreeNode("Schema " + s.getLocator().getSystemId(), s.getLocator()); this.currNode = newNode; this.model.addSchemaNode(newNode); for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) { attGroupDecl(groupDecl); } for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) { attributeDecl(attrDecl); } for (XSComplexType complexType : s.getComplexTypes().values()) { complexType(complexType); } for (XSElementDecl elementDecl : s.getElementDecls().values()) { elementDecl(elementDecl); } for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) { modelGroupDecl(modelGroupDecl); } for (XSSimpleType simpleType : s.getSimpleTypes().values()) { simpleType(simpleType); } }
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(); String str = MessageFormat.format("Restriction {0}", new Object[]{baseType.isLocal() ? "" : " base=\"{" + baseType.getTargetNamespace() + "}" + baseType.getName() + "\""}); SchemaTreeNode newNode = new SchemaTreeNode(str, baseType.getLocator()); this.currNode.add(newNode); this.currNode = newNode; if (baseType.isLocal()) { simpleType(baseType); } Iterator itr = type.iterateDeclaredFacets(); while (itr.hasNext()) { facet((XSFacet) itr.next()); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }
public final Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (value instanceof SchemaTreeNode) { SchemaTreeNode stn = (SchemaTreeNode) value; this.setValues(null, stn.getCaption(), selected); return this; } throw new IllegalStateException("Unknown node"); } }
public void complexType(XSComplexType type) { SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format( "ComplexType {0}", new Object[]{type.isLocal() ? "" : " name=\"" + type.getName() + "\""}), type .getLocator()); this.currNode.add(newNode); this.currNode = newNode; SchemaTreeNode newNode2 = new SchemaTreeNode("Simple content", type .getContentType().getLocator()); this.currNode.add(newNode2); this.currNode = newNode2; baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; this.currNode = (SchemaTreeNode) this.currNode.getParent(); baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; 0)
public void complexType(XSComplexType type) { SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format( "ComplexType {0}", new Object[]{type.isLocal() ? "" : " name=\"" + type.getName() + "\""}), type .getLocator()); this.currNode.add(newNode); this.currNode = newNode; SchemaTreeNode newNode2 = new SchemaTreeNode("Simple content", type .getContentType().getLocator()); this.currNode.add(newNode2); this.currNode = newNode2; baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; this.currNode = (SchemaTreeNode) this.currNode.getParent(); baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; 0)
public void complexType(XSComplexType type) { SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format( "ComplexType {0}", new Object[]{type.isLocal() ? "" : " name=\"" + type.getName() + "\""}), type .getLocator()); this.currNode.add(newNode); this.currNode = newNode; SchemaTreeNode newNode2 = new SchemaTreeNode("Simple content", type .getContentType().getLocator()); this.currNode.add(newNode2); this.currNode = newNode2; baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; this.currNode = (SchemaTreeNode) this.currNode.getParent(); baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; 0)
public void complexType(XSComplexType type) { SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format( "ComplexType {0}", new Object[]{type.isLocal() ? "" : " name=\"" + type.getName() + "\""}), type .getLocator()); this.currNode.add(newNode); this.currNode = newNode; SchemaTreeNode newNode2 = new SchemaTreeNode("Simple content", type .getContentType().getLocator()); this.currNode.add(newNode2); this.currNode = newNode2; baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; this.currNode = (SchemaTreeNode) this.currNode.getParent(); baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; 0)
public void complexType(XSComplexType type) { SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format( "ComplexType {0}", new Object[]{type.isLocal() ? "" : " name=\"" + type.getName() + "\""}), type .getLocator()); this.currNode.add(newNode); this.currNode = newNode; SchemaTreeNode newNode2 = new SchemaTreeNode("Simple content", type .getContentType().getLocator()); this.currNode.add(newNode2); this.currNode = newNode2; baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; this.currNode = (SchemaTreeNode) this.currNode.getParent(); baseType.getTargetNamespace(), baseType.getName()}); SchemaTreeNode newNode3 = new SchemaTreeNode(str, baseType .getLocator()); this.currNode.add(newNode3); this.currNode = newNode3; 0)
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); } }
public void schema(XSSchema s) { // QUICK HACK: don't print the built-in components if (s.getTargetNamespace().equals(Const.schemaNamespace)) { return; } SchemaTreeNode newNode = new SchemaTreeNode("Schema " + s.getLocator().getSystemId(), s.getLocator()); this.currNode = newNode; this.model.addSchemaNode(newNode); for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) { attGroupDecl(groupDecl); } for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) { attributeDecl(attrDecl); } for (XSComplexType complexType : s.getComplexTypes().values()) { complexType(complexType); } for (XSElementDecl elementDecl : s.getElementDecls().values()) { elementDecl(elementDecl); } for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) { modelGroupDecl(modelGroupDecl); } for (XSSimpleType simpleType : s.getSimpleTypes().values()) { simpleType(simpleType); } }
public void schema(XSSchema s) { // QUICK HACK: don't print the built-in components if (s.getTargetNamespace().equals(Const.schemaNamespace)) { return; } SchemaTreeNode newNode = new SchemaTreeNode("Schema " + s.getLocator().getSystemId(), s.getLocator()); this.currNode = newNode; this.model.addSchemaNode(newNode); for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) { attGroupDecl(groupDecl); } for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) { attributeDecl(attrDecl); } for (XSComplexType complexType : s.getComplexTypes().values()) { complexType(complexType); } for (XSElementDecl elementDecl : s.getElementDecls().values()) { elementDecl(elementDecl); } for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) { modelGroupDecl(modelGroupDecl); } for (XSSimpleType simpleType : s.getSimpleTypes().values()) { simpleType(simpleType); } }
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); } }
/** * Creates node for attribute declaration with additional attributes. * * @param decl Attribute declaration. * @param additionalAtts Additional attributes. */ private void dump(XSAttributeDecl decl, String additionalAtts) { XSSimpleType type = decl.getType(); String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}", new Object[]{ decl.getName(), additionalAtts, type.isLocal() ? "" : MessageFormat.format( " type=\"'{'{0}'}'{1}\"", new Object[]{ type.getTargetNamespace(), type.getName()}), decl.getFixedValue() == null ? "" : " fixed=\"" + decl.getFixedValue() + "\"", decl.getDefaultValue() == null ? "" : " default=\"" + decl.getDefaultValue() + "\""}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); this.currNode = newNode; if (type.isLocal()) { simpleType(type); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }
public void schema(XSSchema s) { // QUICK HACK: don't print the built-in components if (s.getTargetNamespace().equals(Const.schemaNamespace)) { return; } SchemaTreeNode newNode = new SchemaTreeNode("Schema " + s.getLocator().getSystemId(), s.getLocator()); this.currNode = newNode; this.model.addSchemaNode(newNode); for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) { attGroupDecl(groupDecl); } for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) { attributeDecl(attrDecl); } for (XSComplexType complexType : s.getComplexTypes().values()) { complexType(complexType); } for (XSElementDecl elementDecl : s.getElementDecls().values()) { elementDecl(elementDecl); } for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) { modelGroupDecl(modelGroupDecl); } for (XSSimpleType simpleType : s.getSimpleTypes().values()) { simpleType(simpleType); } }
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); } }
/** * Creates node for attribute declaration with additional attributes. * * @param decl Attribute declaration. * @param additionalAtts Additional attributes. */ private void dump(XSAttributeDecl decl, String additionalAtts) { XSSimpleType type = decl.getType(); String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}", new Object[]{ decl.getName(), additionalAtts, type.isLocal() ? "" : MessageFormat.format( " type=\"'{'{0}'}'{1}\"", new Object[]{ type.getTargetNamespace(), type.getName()}), decl.getFixedValue() == null ? "" : " fixed=\"" + decl.getFixedValue() + "\"", decl.getDefaultValue() == null ? "" : " default=\"" + decl.getDefaultValue() + "\""}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); this.currNode = newNode; if (type.isLocal()) { simpleType(type); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }
/** * Creates node for attribute declaration with additional attributes. * * @param decl Attribute declaration. * @param additionalAtts Additional attributes. */ private void dump(XSAttributeDecl decl, String additionalAtts) { XSSimpleType type = decl.getType(); String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}", new Object[]{ decl.getName(), additionalAtts, type.isLocal() ? "" : MessageFormat.format( " type=\"'{'{0}'}'{1}\"", new Object[]{ type.getTargetNamespace(), type.getName()}), decl.getFixedValue() == null ? "" : " fixed=\"" + decl.getFixedValue() + "\"", decl.getDefaultValue() == null ? "" : " default=\"" + decl.getDefaultValue() + "\""}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); this.currNode = newNode; if (type.isLocal()) { simpleType(type); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }
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(); String str = MessageFormat.format("Restriction {0}", new Object[]{baseType.isLocal() ? "" : " base=\"{" + baseType.getTargetNamespace() + "}" + baseType.getName() + "\""}); SchemaTreeNode newNode = new SchemaTreeNode(str, baseType.getLocator()); this.currNode.add(newNode); this.currNode = newNode; if (baseType.isLocal()) { simpleType(baseType); } Iterator itr = type.iterateDeclaredFacets(); while (itr.hasNext()) { facet((XSFacet) itr.next()); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }
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); } }
/** * Creates node for attribute declaration with additional attributes. * * @param decl Attribute declaration. * @param additionalAtts Additional attributes. */ private void dump(XSAttributeDecl decl, String additionalAtts) { XSSimpleType type = decl.getType(); String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}", new Object[]{ decl.getName(), additionalAtts, type.isLocal() ? "" : MessageFormat.format( " type=\"'{'{0}'}'{1}\"", new Object[]{ type.getTargetNamespace(), type.getName()}), decl.getFixedValue() == null ? "" : " fixed=\"" + decl.getFixedValue() + "\"", decl.getDefaultValue() == null ? "" : " default=\"" + decl.getDefaultValue() + "\""}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); this.currNode = newNode; if (type.isLocal()) { simpleType(type); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }