org.eclipse.xsd.util
Class XSDResourceImpl

java.lang.Object
  extended byResourceImpl
      extended byorg.eclipse.xsd.util.XSDResourceImpl

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.

See Also:
Serialized Form

Nested Class Summary
static class XSDResourceImpl.SchemaLocator
           
 
Field Summary
protected  Collection attachedSchemas
           
protected static XSDResourceImpl.SchemaLocator SCHEMA_LOCATOR
           
static String XSD_ENCODING
           
static String XSD_PROGRESS_MONITOR
           
static String XSD_TRACK_LOCATION
           
 
Constructor Summary
XSDResourceImpl()
           
XSDResourceImpl(URI uri)
           
 
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(InputSource inputSource, ErrorHandler errorHandler)
          Builds a document using JAXP.
protected static Document getDocument(InputStream inputStream, ErrorHandler errorHandler)
          Builds a document using JAXP.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

XSDResourceImpl

public XSDResourceImpl()

XSDResourceImpl

public XSDResourceImpl(URI uri)
Method Detail

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(InputSource inputSource,
                                      ErrorHandler errorHandler)
                               throws IOException
Builds a document using JAXP.

Parameters:
inputSource - the contents to parse.
errorHandler - the handled used by the parser.
Returns:
a document.
Throws:
IOException

getDocument

protected static Document getDocument(InputStream inputStream,
                                      ErrorHandler errorHandler)
                               throws IOException
Builds a document using JAXP.

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 XSDDiagnostics.

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)

Copyright 2001-2004 IBM Corporation and others.
All Rights Reserved.