use of com.sun.xml.xsom.XSAttGroupDecl in project atlasmap by atlasmap.
the class SchemaTreeTraverser method schema.
/* (non-Javadoc)
* @see com.sun.xml.xsom.visitor.XSVisitor#schema(com.sun.xml.xsom.XSSchema)
*/
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);
}
}
use of com.sun.xml.xsom.XSAttGroupDecl in project atlasmap by atlasmap.
the class AttributesHolder method getAttributeUses.
/**
* Returns the attribute uses by looking at attribute groups and etc.
* Searching for the base type is done in {@link ComplexTypeImpl}.
*/
public Collection<XSAttributeUse> getAttributeUses() {
// TODO: this is fairly inefficient
List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
v.addAll(attributes.values());
for (XSAttGroupDecl agd : getAttGroups()) v.addAll(agd.getAttributeUses());
return v;
}
use of com.sun.xml.xsom.XSAttGroupDecl in project atlasmap by atlasmap.
the class SchemaWriter method schema.
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>");
}
use of com.sun.xml.xsom.XSAttGroupDecl in project atlasmap by atlasmap.
the class SchemaWriter method attGroupDecl.
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>");
}
use of com.sun.xml.xsom.XSAttGroupDecl in project atlasmap by atlasmap.
the class SchemaWriter method dumpComplexTypeAttribute.
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, "");
}
Aggregations