org.eclipse.xsd.util
Class XSDResourceImpl
java.lang.Object
org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.NotifierImpl
org.eclipse.emf.ecore.resource.impl.ResourceImpl
org.eclipse.xsd.util.XSDResourceImpl
- All Implemented Interfaces:
- Notifier, Resource, Resource.Internal
- public class XSDResourceImpl
- extends ResourceImpl
The Resource implementation for the model.
This specialized resource implementation supports it's own way of making keys and hrefs, and it's own serialization.
This class is not intended for subclassing outside of the model implementation;
it is intended to be used as is with the Resource framework.
Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
contents, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isModified, modificationTrackingAdapter, resourceSet, uri, warnings |
Method Summary |
protected static void |
assignDiagnostics(XSDSchema xsdSchema,
java.util.Collection xsdDiagnostics)
Assigns diagnostics to a schema. |
void |
attached(EObject eObject)
|
protected static org.xml.sax.EntityResolver |
createEntityResolver()
Creates an EntityResovler that can be used to help with parsing schema documents. |
protected void |
doLoad(java.io.InputStream inputStream,
java.util.Map options)
Loads a new XSDResourceImpl into the resource set. |
protected void |
doSave(java.io.OutputStream os,
java.util.Map options)
|
protected static void |
doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document)
|
protected static void |
doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document,
java.lang.String encoding)
|
protected static void |
doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element)
|
protected static void |
doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element,
java.lang.String encoding)
|
protected boolean |
findSchemas(org.w3c.dom.Element element)
|
java.util.Map |
getDefaultSaveOptions()
|
protected static org.w3c.dom.Document |
getDocument(org.xml.sax.InputSource inputSource,
org.xml.sax.ErrorHandler errorHandler)
Builds a document using JAXP. |
protected static org.w3c.dom.Document |
getDocument(java.io.InputStream inputStream,
org.xml.sax.ErrorHandler errorHandler)
Builds a document using JAXP. |
EObject |
getEObject(java.lang.String uriFragment)
|
java.util.Map |
getLoadSaveOptions()
|
XSDSchema |
getSchema()
This gets the resource's schema. |
java.lang.String |
getURIFragment(EObject eObject)
|
protected void |
handleSchemaElement(org.w3c.dom.Element element,
boolean isMeta)
|
static void |
serialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document)
|
static void |
serialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document,
java.lang.String encoding)
|
static void |
serialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element)
|
static void |
serialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element,
java.lang.String encoding)
|
void |
setModified(boolean isModified)
|
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
addModificationTrackingAdapters, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, detached, detachedHelper, doUnload, getAllContents, getContents, getDefaultURIConverter, getEObject, getEObjectByID, getEObjectForURIFragmentRootSegment, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getURI, getURIConverter, getURIFragmentRootSegment, getWarnings, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isModified, isTrackingModification, load, load, newContentZipEntry, removeModificationTrackingAdapters, save, save, setIntrinsicIDToEObjectMap, setLoaded, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
XSD_TRACK_LOCATION
public static java.lang.String XSD_TRACK_LOCATION
XSD_PROGRESS_MONITOR
public static java.lang.String XSD_PROGRESS_MONITOR
XSD_ENCODING
public static java.lang.String XSD_ENCODING
SCHEMA_LOCATOR
protected static final XSDResourceImpl.SchemaLocator SCHEMA_LOCATOR
attachedSchemas
protected java.util.Collection attachedSchemas
XSDResourceImpl
public XSDResourceImpl()
XSDResourceImpl
public XSDResourceImpl(URI uri)
serialize
public static void serialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element)
serialize
public static void serialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element,
java.lang.String encoding)
doSerialize
protected static void doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element)
throws java.io.IOException
- Throws:
java.io.IOException
doSerialize
protected static void doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Element element,
java.lang.String encoding)
throws java.io.IOException
- Throws:
java.io.IOException
serialize
public static void serialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document)
serialize
public static void serialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document,
java.lang.String encoding)
doSerialize
protected static void doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document)
throws java.io.IOException
- Throws:
java.io.IOException
doSerialize
protected static void doSerialize(java.io.OutputStream outputStream,
org.w3c.dom.Document document,
java.lang.String encoding)
throws java.io.IOException
- Throws:
java.io.IOException
getDocument
protected static org.w3c.dom.Document getDocument(org.xml.sax.InputSource inputSource,
org.xml.sax.ErrorHandler errorHandler)
throws java.io.IOException
- Builds a document using JAXP.
- Parameters:
inputSource
- the contents to parse.errorHandler
- the handled used by the parser.
- Returns:
- a document.
- Throws:
java.io.IOException
getDocument
protected static org.w3c.dom.Document getDocument(java.io.InputStream inputStream,
org.xml.sax.ErrorHandler errorHandler)
throws java.io.IOException
- Builds a document using JAXP.
- Parameters:
inputStream
- the contents to parse.errorHandler
- the handled used by the parser.
- Returns:
- a document.
- Throws:
java.io.IOException
createEntityResolver
protected static org.xml.sax.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 XSDDiagnostic
s.
doSave
protected void doSave(java.io.OutputStream os,
java.util.Map options)
throws java.io.IOException
- Throws:
java.io.IOException
getSchema
public XSDSchema getSchema()
- This gets the resource's schema.
doLoad
protected void doLoad(java.io.InputStream inputStream,
java.util.Map options)
throws java.io.IOException
- Loads a new
XSDResourceImpl
into the resource set.
- Parameters:
inputStream
- the contents of the new resource.options
- any options to influence loading behavior.
- Returns:
- a new XSDResourceImpl.
- Throws:
java.io.IOException
findSchemas
protected boolean findSchemas(org.w3c.dom.Element element)
handleSchemaElement
protected void handleSchemaElement(org.w3c.dom.Element element,
boolean isMeta)
attached
public void attached(EObject eObject)
getURIFragment
public java.lang.String getURIFragment(EObject eObject)
getEObject
public EObject getEObject(java.lang.String uriFragment)
getDefaultSaveOptions
public java.util.Map getDefaultSaveOptions()
getLoadSaveOptions
public java.util.Map getLoadSaveOptions()
setModified
public void setModified(boolean isModified)