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.
Method Summary |
protected static void |
assignDiagnostics(XSDSchema xsdSchema,
Collection xsdDiagnostics)
Assigns diagnostics to a schema. |
void |
attached(EObject eObject)
|
protected static EntityResolver |
createEntityResolver()
Creates an EntityResovler that can be used to help with parsing schema documents. |
protected void |
doLoad(InputStream inputStream,
Map options)
Loads a new XSDResourceImpl into the resource set. |
protected void |
doSave(OutputStream os,
Map options)
|
protected static void |
doSerialize(OutputStream outputStream,
Document document)
|
protected static void |
doSerialize(OutputStream outputStream,
Document document,
String encoding)
|
protected static void |
doSerialize(OutputStream outputStream,
Element element)
|
protected static void |
doSerialize(OutputStream outputStream,
Element element,
String encoding)
|
protected boolean |
findSchemas(Element element)
|
Map |
getDefaultSaveOptions()
|
protected static Document |
getDocument(InputStream inputStream,
ErrorHandler errorHandler)
Builds a document using Xerces. |
EObject |
getEObject(String uriFragment)
|
Map |
getLoadSaveOptions()
|
XSDSchema |
getSchema()
This gets the resource's schema. |
String |
getURIFragment(EObject eObject)
|
protected void |
handleSchemaElement(Element element,
boolean isMeta)
|
static void |
serialize(OutputStream outputStream,
Document document)
|
static void |
serialize(OutputStream outputStream,
Document document,
String encoding)
|
static void |
serialize(OutputStream outputStream,
Element element)
|
static void |
serialize(OutputStream outputStream,
Element element,
String encoding)
|
void |
setModified(boolean isModified)
|
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
addModificationTrackingAdapters, basicSetResourceSet, createModificationTrackingAdapter, detached, doUnload, getAllContents, getContents, getDefaultURIConverter, getEObject, getEObjectByID, getEObjectForURIFragmentRootSegment, getErrors, getResourceSet, getURI, getURIConverter, getURIFragmentRootSegment, getWarnings, isContentZipEntry, isLoaded, isModified, isTrackingModification, load, load, newContentZipEntry, removeModificationTrackingAdapters, save, save, setLoaded, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZip |
XSD_TRACK_LOCATION
public static String XSD_TRACK_LOCATION
XSD_PROGRESS_MONITOR
public static String XSD_PROGRESS_MONITOR
XSD_ENCODING
public static String XSD_ENCODING
SCHEMA_LOCATOR
protected static final XSDResourceImpl.SchemaLocator SCHEMA_LOCATOR
attachedSchemas
protected Collection attachedSchemas
XSDResourceImpl
public XSDResourceImpl()
XSDResourceImpl
public XSDResourceImpl(URI uri)
serialize
public static void serialize(OutputStream outputStream,
Element element)
serialize
public static void serialize(OutputStream outputStream,
Element element,
String encoding)
doSerialize
protected static void doSerialize(OutputStream outputStream,
Element element)
throws IOException
- Throws:
IOException
doSerialize
protected static void doSerialize(OutputStream outputStream,
Element element,
String encoding)
throws IOException
- Throws:
IOException
serialize
public static void serialize(OutputStream outputStream,
Document document)
serialize
public static void serialize(OutputStream outputStream,
Document document,
String encoding)
doSerialize
protected static void doSerialize(OutputStream outputStream,
Document document)
throws IOException
- Throws:
IOException
doSerialize
protected static void doSerialize(OutputStream outputStream,
Document document,
String encoding)
throws IOException
- Throws:
IOException
getDocument
protected static Document getDocument(InputStream inputStream,
ErrorHandler errorHandler)
throws IOException
- Builds a document using Xerces.
- Parameters:
inputStream
- the contents to parse.errorHandler
- the handled used by the parser.
- Returns:
- a document.
- Throws:
IOException
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,
Collection xsdDiagnostics)
- Assigns diagnostics to a schema.
- Parameters:
xsdSchema
- the schema.xsdDiagnostics
- the XSDDiagnostic
s.
doSave
protected void doSave(OutputStream os,
Map options)
throws IOException
- Throws:
IOException
getSchema
public XSDSchema getSchema()
- This gets the resource's schema.
doLoad
protected void doLoad(InputStream inputStream,
Map options)
throws 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:
IOException
findSchemas
protected boolean findSchemas(Element element)
handleSchemaElement
protected void handleSchemaElement(Element element,
boolean isMeta)
attached
public void attached(EObject eObject)
getURIFragment
public String getURIFragment(EObject eObject)
getEObject
public EObject getEObject(String uriFragment)
getDefaultSaveOptions
public Map getDefaultSaveOptions()
getLoadSaveOptions
public Map getLoadSaveOptions()
setModified
public void setModified(boolean isModified)