com.ibm.etools.xsd.util
Class XSDResourceFactoryImpl

java.lang.Object
  |
  +--com.ibm.etools.emf.resource.impl.ResourceFactoryImpl
        |
        +--com.ibm.etools.xsd.util.XSDResourceFactoryImpl
All Implemented Interfaces:
com.ibm.etools.emf.resource.ResourceFactory

public class XSDResourceFactoryImpl
extends com.ibm.etools.emf.resource.impl.ResourceFactoryImpl

The Resource Factory implementation for the model. This class is the XSD resource factory that knows how to parse .xsd files to produce a MOF model. This class is not intended for subclassing outside of the model implementation; it is intended to be used as is with the Resource framework.

See Also:
XSDResourceImpl, XSDParser

Field Summary
static java.lang.String copyright
           
protected  org.eclipse.core.runtime.IProgressMonitor progressMonitor
          The progress monitor used during loading.
protected  boolean trackingLocation
          The indicator of whether line and column locations are computed.
 
Fields inherited from class com.ibm.etools.emf.resource.impl.ResourceFactoryImpl
lastResourceLoaded
 
Constructor Summary
XSDResourceFactoryImpl()
          Creates an instance.
 
Method Summary
protected static void assignDiagnostics(XSDSchema xsdSchema, java.util.Collection xsdDiagnostics)
          Assigns diagnostics to a schema.
protected static EntityResolver createEntityResolver()
          Creates an EntityResovler that can be used to help with parsing schema documents.
protected static Document getDocument(java.io.InputStream inputStream, ErrorHandler errorHandler)
          Builds a document using Xerces.
 org.eclipse.core.runtime.IProgressMonitor getProgressMonitor()
          Returns the progress monitor used during loading.
 boolean isTrackingLocation()
          Returns whether location information is computed in the generated DOM.
 com.ibm.etools.emf.resource.Resource load(com.ibm.etools.emf.resource.ResourceSet resourceSet, java.lang.String uri, java.io.InputStream inputStream, java.lang.Object options)
          Loads a new XSDResourceImpl into the resource set.
 com.ibm.etools.emf.resource.Resource makeResource(java.lang.String uri, com.ibm.etools.emf.ref.Extent extent)
          Creates an XSDResourceImpl.
 void setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          Sets the progress monitor used during loading.
 void setTrackingLocation(boolean trackingLocation)
          Sets whether location information is computed in the generated DOM.
 
Methods inherited from class com.ibm.etools.emf.resource.impl.ResourceFactoryImpl
createExtent, getDefaultLoadOptions, load, load, load, load, load, load, load, makeResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright

progressMonitor

protected org.eclipse.core.runtime.IProgressMonitor progressMonitor
The progress monitor used during loading.

trackingLocation

protected boolean trackingLocation
The indicator of whether line and column locations are computed.
See Also:
XSDParser.getUserData(org.w3c.dom.Node)
Constructor Detail

XSDResourceFactoryImpl

public XSDResourceFactoryImpl()
Creates an instance.
Method Detail

getProgressMonitor

public org.eclipse.core.runtime.IProgressMonitor getProgressMonitor()
Returns the progress monitor used during loading.
Returns:
the progress monitor.

setProgressMonitor

public void setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Sets the progress monitor used during loading.
Parameters:
progress - monitor the progress monitor.

isTrackingLocation

public boolean isTrackingLocation()
Returns whether location information is computed in the generated DOM.
Returns:
whether location information is computed in the generated DOM.
See Also:
XSDParser.getUserData(org.w3c.dom.Node)

setTrackingLocation

public void setTrackingLocation(boolean trackingLocation)
Sets whether location information is computed in the generated DOM.
Parameters:
trackingLocation - whether location information is computed.
See Also:
XSDParser.getUserData(org.w3c.dom.Node)

makeResource

public com.ibm.etools.emf.resource.Resource makeResource(java.lang.String uri,
                                                         com.ibm.etools.emf.ref.Extent extent)
Creates an XSDResourceImpl.
Overrides:
makeResource in class com.ibm.etools.emf.resource.impl.ResourceFactoryImpl
Parameters:
uri - the URI of the new resource.
extent - the extent of the new resource.
Returns:
an XSDResourceImpl.

load

public com.ibm.etools.emf.resource.Resource load(com.ibm.etools.emf.resource.ResourceSet resourceSet,
                                                 java.lang.String uri,
                                                 java.io.InputStream inputStream,
                                                 java.lang.Object options)
                                          throws java.lang.Exception
Loads a new XSDResourceImpl into the resource set.
Overrides:
load in class com.ibm.etools.emf.resource.impl.ResourceFactoryImpl
Parameters:
resourceSet - the resource set to hold the new resource.
uri - the URI of the new resource.
inputStream - the contents of the new resource.
options - any options to influence loading behavior.
Returns:
a new XSDResourceImpl.

getDocument

protected static Document getDocument(java.io.InputStream inputStream,
                                      ErrorHandler errorHandler)
                               throws java.lang.Exception
Builds a document using Xerces.
Parameters:
inputStream - the contents to parse.
errorHandler - the handled used by the parser.
Returns:
a document.

createEntityResolver

protected static EntityResolver createEntityResolver()
Creates an EntityResovler that can be used to help with parsing schema documents.
Returns:
an EntityResolver.

assignDiagnostics

protected static void assignDiagnostics(XSDSchema xsdSchema,
                                        java.util.Collection xsdDiagnostics)
Assigns diagnostics to a schema.
Parameters:
xsdSchema - the schema.
xsdDiagnostics - the XSDDiagnostics.