Package com.sun.xml.xsom.impl.util
Class SchemaWriter
- java.lang.Object
-
- com.sun.xml.xsom.impl.util.SchemaWriter
-
- All Implemented Interfaces:
XSContentTypeVisitor
,XSSimpleTypeVisitor
,XSTermVisitor
,XSVisitor
public class SchemaWriter extends java.lang.Object implements XSVisitor, XSSimpleTypeVisitor
Generates approximated XML Schema representation from a schema component. This is not intended to be a fully-fledged round-trippable schema writer.Usage of this class
- Create a new instance with whatever Writer you'd like to send the output to.
- Call one of the overloaded dump methods. You can repeat this process as many times as you want.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
hadError
If IOException is encountered, this flag is set to true.private int
indent
indentation.private java.io.Writer
out
output is sent to this object.private static XSWildcardFunction<java.lang.String>
WILDCARD_NS
-
Constructor Summary
Constructors Constructor Description SchemaWriter(java.io.Writer _out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
annotation(XSAnnotation ann)
void
attGroupDecl(XSAttGroupDecl decl)
void
attributeDecl(XSAttributeDecl decl)
void
attributeUse(XSAttributeUse use)
boolean
checkError()
Flush the stream and check its error state.void
complexType(XSComplexType type)
private void
dump(XSAttributeDecl decl, java.lang.String additionalAtts)
private void
dumpComplexTypeAttribute(XSComplexType type)
void
dumpRef(XSAttGroupDecl decl)
void
elementDecl(XSElementDecl decl)
private void
elementDecl(XSElementDecl decl, java.lang.String extraAtts)
void
empty(XSContentType t)
void
facet(XSFacet facet)
void
identityConstraint(XSIdentityConstraint decl)
void
listSimpleType(XSListSimpleType type)
void
modelGroup(XSModelGroup group)
private void
modelGroup(XSModelGroup group, java.lang.String extraAtts)
void
modelGroupDecl(XSModelGroupDecl decl)
void
notation(XSNotation notation)
void
particle(XSParticle part)
private void
println()
private void
println(java.lang.String s)
void
restrictionSimpleType(XSRestrictionSimpleType type)
void
schema(XSSchema s)
void
simpleType(XSSimpleType type)
void
unionSimpleType(XSUnionSimpleType type)
void
visit(XSSchemaSet s)
void
wildcard(XSWildcard wc)
private void
wildcard(java.lang.String tagName, XSWildcard wc, java.lang.String extraAtts)
void
xpath(XSXPath xp)
-
-
-
Field Detail
-
out
private final java.io.Writer out
output is sent to this object.
-
indent
private int indent
indentation.
-
hadError
private boolean hadError
If IOException is encountered, this flag is set to true.
-
WILDCARD_NS
private static final XSWildcardFunction<java.lang.String> WILDCARD_NS
-
-
Method Detail
-
println
private void println(java.lang.String s)
-
println
private void println()
-
checkError
public boolean checkError()
Flush the stream and check its error state.
-
visit
public void visit(XSSchemaSet s)
-
attGroupDecl
public void attGroupDecl(XSAttGroupDecl decl)
- Specified by:
attGroupDecl
in interfaceXSVisitor
-
dumpRef
public void dumpRef(XSAttGroupDecl decl)
-
attributeUse
public void attributeUse(XSAttributeUse use)
- Specified by:
attributeUse
in interfaceXSVisitor
-
attributeDecl
public void attributeDecl(XSAttributeDecl decl)
- Specified by:
attributeDecl
in interfaceXSVisitor
-
dump
private void dump(XSAttributeDecl decl, java.lang.String additionalAtts)
-
simpleType
public void simpleType(XSSimpleType type)
- Specified by:
simpleType
in interfaceXSContentTypeVisitor
-
listSimpleType
public void listSimpleType(XSListSimpleType type)
- Specified by:
listSimpleType
in interfaceXSSimpleTypeVisitor
-
unionSimpleType
public void unionSimpleType(XSUnionSimpleType type)
- Specified by:
unionSimpleType
in interfaceXSSimpleTypeVisitor
-
restrictionSimpleType
public void restrictionSimpleType(XSRestrictionSimpleType type)
- Specified by:
restrictionSimpleType
in interfaceXSSimpleTypeVisitor
-
notation
public void notation(XSNotation notation)
-
complexType
public void complexType(XSComplexType type)
- Specified by:
complexType
in interfaceXSVisitor
-
dumpComplexTypeAttribute
private void dumpComplexTypeAttribute(XSComplexType type)
-
elementDecl
public void elementDecl(XSElementDecl decl)
- Specified by:
elementDecl
in interfaceXSTermVisitor
-
elementDecl
private void elementDecl(XSElementDecl decl, java.lang.String extraAtts)
-
modelGroupDecl
public void modelGroupDecl(XSModelGroupDecl decl)
- Specified by:
modelGroupDecl
in interfaceXSTermVisitor
-
modelGroup
public void modelGroup(XSModelGroup group)
- Specified by:
modelGroup
in interfaceXSTermVisitor
-
modelGroup
private void modelGroup(XSModelGroup group, java.lang.String extraAtts)
-
particle
public void particle(XSParticle part)
- Specified by:
particle
in interfaceXSContentTypeVisitor
-
wildcard
public void wildcard(XSWildcard wc)
- Specified by:
wildcard
in interfaceXSTermVisitor
-
wildcard
private void wildcard(java.lang.String tagName, XSWildcard wc, java.lang.String extraAtts)
-
annotation
public void annotation(XSAnnotation ann)
- Specified by:
annotation
in interfaceXSVisitor
-
identityConstraint
public void identityConstraint(XSIdentityConstraint decl)
- Specified by:
identityConstraint
in interfaceXSVisitor
-
empty
public void empty(XSContentType t)
- Specified by:
empty
in interfaceXSContentTypeVisitor
-
-