|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.sequencer.xsd.XsdReader
@NotThreadSafe public class XsdReader
A class that can parse XML Schema Documents, derive a graph structure from the content, and output that graph structure to a
supplied SequencerOutput
.
This class can be subclassed and any of the 'process' methods overridden to customize the dervied graph structure.
Nested Class Summary | |
---|---|
protected class |
XsdReader.ResolveFuture
|
Field Summary | |
---|---|
protected StreamSequencerContext |
context
|
protected Logger |
logger
|
protected Map<Path,Multimap<Name,Integer>> |
namesByParentPath
|
protected SequencerOutput |
output
|
protected List<XsdReader.ResolveFuture> |
resolveFutures
|
protected XsdResolvers |
resolvers
|
static String |
UNBOUNDED
|
Constructor Summary | |
---|---|
XsdReader(SequencerOutput output,
StreamSequencerContext context)
|
|
XsdReader(SequencerOutput output,
StreamSequencerContext context,
XsdResolvers resolvers)
|
Method Summary | ||
---|---|---|
StreamSequencerContext |
getContext()
Get the sequencing context in which this reader is being used. |
|
XsdResolvers |
getResolvers()
|
|
protected Name |
name(String name)
|
|
protected Name |
name(String namespaceUri,
String name)
|
|
protected Path |
nextPath(Path parentPath,
Name name)
|
|
protected Path |
path(Path parentPath,
Name segment)
|
|
protected Path |
path(Path parentPath,
String segment)
|
|
protected Path |
path(String path)
|
|
protected String |
prefixForNamespace(String namespaceUri,
String defaultPrefix)
|
|
protected
|
process(Iterable<Facet> facets,
Path path,
Name propertyName,
PropertyType type)
|
|
protected Path |
process(Iterable<org.eclipse.xsd.XSDAnnotation> annotations,
Path path)
|
|
protected Path |
process(org.eclipse.xsd.XSDAnnotation annotation,
Path path)
|
|
protected Path |
process(org.eclipse.xsd.XSDAttributeDeclaration decl,
Path parentPath,
boolean isUse)
|
|
protected Path |
process(org.eclipse.xsd.XSDAttributeGroupContent content,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDAttributeGroupDefinition defn,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDAttributeUse use,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDComplexTypeContent content,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDComplexTypeDefinition type,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDElementDeclaration decl,
Path parentPath)
|
|
protected void |
process(org.eclipse.xsd.XSDFacet facet,
Path path,
Name propertyName,
PropertyType type)
|
|
protected Path |
process(org.eclipse.xsd.XSDImport xsdImport,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDInclude xsdInclude,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDModelGroupDefinition defn,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDModelGroup group,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDParticle content,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDRedefine redefine,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDSchema schema,
String encoding,
String mimeType,
long contentSize,
Path path)
Read an XSDSchema instance. |
|
protected Path |
process(org.eclipse.xsd.XSDSimpleTypeDefinition type,
Path parentPath)
|
|
protected Path |
process(org.eclipse.xsd.XSDWildcard wildcard,
Path parentPath)
|
|
protected
|
processEnumerator(Enumerator enumerator,
Path path,
Name propertyName)
|
|
protected
|
processEnumerators(Iterable<Enumerator> enumerators,
Path path,
Name propertyName)
|
|
protected Path |
processFacetsOf(org.eclipse.xsd.XSDSimpleTypeDefinition type,
Path path,
org.eclipse.xsd.XSDTypeDefinition baseType)
|
|
protected Path |
processNonSchemaAttributes(org.eclipse.xsd.XSDConcreteComponent component,
Path path)
|
|
void |
read(InputSource source,
Path docPath)
Read the XML Schema Document from the supplied source, and produce the derived content. |
|
void |
read(InputStream stream,
Path docPath)
Read the XML Schema Document from the supplied stream, and produce the derived content. |
|
void |
read(String xsdContent,
Path docPath)
Read the XML Schema Document from the supplied string, and produce the derived content. |
|
void |
resolveReferences()
Attempt to resolve any references that remain unresolved. |
|
protected UUID |
setReference(Path path,
Name propertyName,
XsdResolvers.SymbolSpace kind,
String namespace,
String name)
|
|
protected UUID |
setUuid(Path path)
|
|
protected String |
string(Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UNBOUNDED
protected final SequencerOutput output
protected final StreamSequencerContext context
protected final Logger logger
protected final Map<Path,Multimap<Name,Integer>> namesByParentPath
protected final XsdResolvers resolvers
protected List<XsdReader.ResolveFuture> resolveFutures
Constructor Detail |
---|
public XsdReader(SequencerOutput output, StreamSequencerContext context, XsdResolvers resolvers)
public XsdReader(SequencerOutput output, StreamSequencerContext context)
Method Detail |
---|
public XsdResolvers getResolvers()
public StreamSequencerContext getContext()
public void read(String xsdContent, Path docPath)
context's
problems
.
xsdContent
- the stream containing the XSD content; may not be nulldocPath
- the path at which the derived content for the XSD should be written (usually this path represents the XSD
file itself); may not be nullpublic void read(InputStream stream, Path docPath)
context's
problems
.
stream
- the stream containing the XSD content; may not be nulldocPath
- the path at which the derived content for the XSD should be written (usually this path represents the XSD
file itself); may not be nullpublic void read(InputSource source, Path docPath)
context's
problems
.
source
- the input source containing the XSD content; may not be nulldocPath
- the path at which the derived content for the XSD should be written (usually this path represents the XSD
file itself); may not be nullprotected Path process(org.eclipse.xsd.XSDSchema schema, String encoding, String mimeType, long contentSize, Path path)
schema
- encoding
- mimeType
- contentSize
- path
- the desired path of the derived node representing the schema; may not be null
protected Path process(org.eclipse.xsd.XSDImport xsdImport, Path parentPath)
protected Path process(org.eclipse.xsd.XSDInclude xsdInclude, Path parentPath)
protected Path process(org.eclipse.xsd.XSDRedefine redefine, Path parentPath)
protected Path process(org.eclipse.xsd.XSDSimpleTypeDefinition type, Path parentPath)
protected Path processFacetsOf(org.eclipse.xsd.XSDSimpleTypeDefinition type, Path path, org.eclipse.xsd.XSDTypeDefinition baseType)
protected Path process(org.eclipse.xsd.XSDComplexTypeDefinition type, Path parentPath)
protected Path process(org.eclipse.xsd.XSDElementDeclaration decl, Path parentPath)
protected Path process(org.eclipse.xsd.XSDAttributeDeclaration decl, Path parentPath, boolean isUse)
protected Path process(org.eclipse.xsd.XSDComplexTypeContent content, Path parentPath)
protected Path process(org.eclipse.xsd.XSDParticle content, Path parentPath)
protected Path process(org.eclipse.xsd.XSDModelGroupDefinition defn, Path parentPath)
protected Path process(org.eclipse.xsd.XSDModelGroup group, Path parentPath)
protected Path process(org.eclipse.xsd.XSDAttributeGroupContent content, Path parentPath)
protected Path process(org.eclipse.xsd.XSDAttributeGroupDefinition defn, Path parentPath)
protected Path process(org.eclipse.xsd.XSDWildcard wildcard, Path parentPath)
protected Path process(org.eclipse.xsd.XSDAttributeUse use, Path parentPath)
protected Path processNonSchemaAttributes(org.eclipse.xsd.XSDConcreteComponent component, Path path)
protected String prefixForNamespace(String namespaceUri, String defaultPrefix)
protected Path process(org.eclipse.xsd.XSDAnnotation annotation, Path path)
protected Path process(Iterable<org.eclipse.xsd.XSDAnnotation> annotations, Path path)
protected void process(org.eclipse.xsd.XSDFacet facet, Path path, Name propertyName, PropertyType type)
protected <Facet extends org.eclipse.xsd.XSDFacet> void process(Iterable<Facet> facets, Path path, Name propertyName, PropertyType type)
protected <Enumerator extends org.eclipse.emf.common.util.AbstractEnumerator> void processEnumerators(Iterable<Enumerator> enumerators, Path path, Name propertyName)
protected <Enumerator extends org.eclipse.emf.common.util.AbstractEnumerator> void processEnumerator(Enumerator enumerator, Path path, Name propertyName)
protected Path nextPath(Path parentPath, Name name)
protected Path path(Path parentPath, Name segment)
protected Path path(Path parentPath, String segment)
protected Path path(String path)
protected Name name(String name)
protected Name name(String namespaceUri, String name)
protected String string(Object value)
protected UUID setUuid(Path path)
public void resolveReferences()
XsdResolvers
with
multiple XsdReader
instances.
protected UUID setReference(Path path, Name propertyName, XsdResolvers.SymbolSpace kind, String namespace, String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |