org.modeshape.sequencer.wsdl
Class WsdlReader<T>

java.lang.Object
  extended by org.modeshape.sequencer.wsdl.WsdlReader<T>
Type Parameters:
T - the type of object returned by the parser
Direct Known Subclasses:
Wsdl11Reader

@NotThreadSafe
public abstract class WsdlReader<T>
extends Object

A class that can parse WSDL definitions, derive a graph structure from the content, and output that graph structure to a supplied SequencerOutput.

This class is intended to be subclassed by supplying implementations for the parse(InputSource,String) and process(Object, Path, long) methods.


Nested Class Summary
protected  class WsdlReader.ResolveFuture
           
 
Field Summary
protected  StreamSequencerContext context
           
protected  Logger logger
           
protected  Map<Path,Multimap<Name,Integer>> namesByParentPath
           
protected  SequencerOutput output
           
protected  List<WsdlReader.ResolveFuture> resolveFutures
           
protected  XsdResolvers resolvers
           
static String UNBOUNDED
           
 
Constructor Summary
protected WsdlReader(SequencerOutput output, StreamSequencerContext context)
           
 
Method Summary
 StreamSequencerContext getContext()
          Get the sequencing context in which this reader is being used.
protected  Name name(String name)
           
protected  Name name(String namespaceUri, String name)
           
protected  Path nextPath(Path parentPath, Name name)
           
protected abstract  T parse(InputSource source, String baseUri)
          Parse the supplied source (which contains either a Reader or an InputStream) and produce a representation of the WSDL definition.
protected  Path path(Path parentPath, Name segment)
           
protected  Path path(Path parentPath, Path subpath)
           
protected  Path path(Path parentPath, String segment)
           
protected  Path path(String path)
           
protected  String prefixForNamespace(String namespaceUri, String defaultPrefix)
           
protected abstract  void process(T parsedForm, Path docPath, long sizeOfFile)
          Process the supplied representation of the WSDL definition that was returned from the parse(InputSource, String) method, derive the output content, and write that derived output content to the SequencerOutput.
 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.
protected  void resolveReferences()
           
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

UNBOUNDED

public static final String UNBOUNDED
See Also:
Constant Field Values

output

protected final SequencerOutput output

context

protected final StreamSequencerContext context

logger

protected final Logger logger

namesByParentPath

protected final Map<Path,Multimap<Name,Integer>> namesByParentPath

resolvers

protected final XsdResolvers resolvers

resolveFutures

protected List<WsdlReader.ResolveFuture> resolveFutures
Constructor Detail

WsdlReader

protected WsdlReader(SequencerOutput output,
                     StreamSequencerContext context)
Method Detail

getContext

public StreamSequencerContext getContext()
Get the sequencing context in which this reader is being used.

Returns:
context the context; never null

read

public void read(String xsdContent,
                 Path docPath)
Read the XML Schema Document from the supplied string, and produce the derived content. Any problems or exceptions are written to the context's problems.

Parameters:
xsdContent - the stream containing the XSD content; may not be null
docPath - the path at which the derived content for the XSD should be written (usually this path represents the XSD file itself); may not be null

read

public void read(InputStream stream,
                 Path docPath)
Read the XML Schema Document from the supplied stream, and produce the derived content. Any problems or exceptions are written to the context's problems.

Parameters:
stream - the stream containing the XSD content; may not be null
docPath - the path at which the derived content for the XSD should be written (usually this path represents the XSD file itself); may not be null

read

public void read(InputSource source,
                 Path docPath)
Read the XML Schema Document from the supplied source, and produce the derived content. Any problems or exceptions are written to the context's problems.

Parameters:
source - the input source containing the XSD content; may not be null
docPath - the path at which the derived content for the XSD should be written (usually this path represents the XSD file itself); may not be null

parse

protected abstract T parse(InputSource source,
                           String baseUri)
                    throws Exception
Parse the supplied source (which contains either a Reader or an InputStream) and produce a representation of the WSDL definition.

Parameters:
source - the source containing the WSDL stream; never null
baseUri - the URI of the document being read; never null or empty
Returns:
the WSDL definition representation; may not be null
Throws:
Exception - if there is a problem during parsing

process

protected abstract void process(T parsedForm,
                                Path docPath,
                                long sizeOfFile)
                         throws Exception
Process the supplied representation of the WSDL definition that was returned from the parse(InputSource, String) method, derive the output content, and write that derived output content to the SequencerOutput.

Parameters:
parsedForm - the representation of the WSDL definition, which will always be the value returned from parse(InputSource, String)
docPath - the path at which this method should generate the output structure derived from the WSDL representation
sizeOfFile - the size of the WSDL stream, in bytes
Throws:
Exception - if there is a problem during processing

nextPath

protected Path nextPath(Path parentPath,
                        Name name)

path

protected Path path(Path parentPath,
                    Path subpath)

path

protected Path path(Path parentPath,
                    Name segment)

path

protected Path path(Path parentPath,
                    String segment)

path

protected Path path(String path)

name

protected Name name(String name)

name

protected Name name(String namespaceUri,
                    String name)

string

protected String string(Object value)

setUuid

protected UUID setUuid(Path path)

resolveReferences

protected void resolveReferences()

prefixForNamespace

protected String prefixForNamespace(String namespaceUri,
                                    String defaultPrefix)

setReference

protected UUID setReference(Path path,
                            Name propertyName,
                            XsdResolvers.SymbolSpace kind,
                            String namespace,
                            String name)


Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.