|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl
public class ExtensibleURIConverterImpl
A highly functional and extensible URI converter implementation.
This implementation provides seamless transparent Eclipse integration
by supporting the platform:/resource mechanism both inside of Eclipse and outside of Eclipse.
Furthermore, although the implementation imports
both org.eclipse.core.runtime and org.eclipse.core.resources,
and hence requires the Eclipse libraries at development time,
the implementation does not require them at runtime.
Clients of this implementation must be cautious if they wish to maintain this platform neutral behaviour.
| Nested Class Summary | |
|---|---|
protected static class |
ExtensibleURIConverterImpl.ContentHandlerList
|
protected static class |
ExtensibleURIConverterImpl.URIHandlerList
|
static interface |
ExtensibleURIConverterImpl.URIMap
A map that remaps URIs. |
| Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.URIConverter |
|---|
URIConverter.Cipher, URIConverter.Readable, URIConverter.ReadableInputStream, URIConverter.Writeable, URIConverter.WriteableOutputStream |
| Field Summary | |
|---|---|
protected ExtensibleURIConverterImpl.ContentHandlerList |
contentHandlers
|
protected ExtensibleURIConverterImpl.URIHandlerList |
uriHandlers
|
protected ExtensibleURIConverterImpl.URIMap |
uriMap
The URI map. |
| Fields inherited from interface org.eclipse.emf.ecore.resource.URIConverter |
|---|
ATTRIBUTE_ARCHIVE, ATTRIBUTE_DIRECTORY, ATTRIBUTE_EXECUTABLE, ATTRIBUTE_HIDDEN, ATTRIBUTE_LENGTH, ATTRIBUTE_READ_ONLY, ATTRIBUTE_TIME_STAMP, INSTANCE, NULL_TIME_STAMP, OPTION_REQUESTED_ATTRIBUTES, OPTION_RESPONSE, OPTION_URI_CONVERTER, RESPONSE_TIME_STAMP_PROPERTY, URI_MAP |
| Constructor Summary | |
|---|---|
ExtensibleURIConverterImpl()
Creates an instance. |
|
ExtensibleURIConverterImpl(java.util.Collection<URIHandler> uriHandlers,
java.util.Collection<ContentHandler> contentHandlers)
Creates an instance. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,?> |
contentDescription(URI uri,
java.util.Map<?,?> options)
Returns a map from String properties to their corresponding values representing a description the given URI's contents. |
java.io.InputStream |
createInputStream(URI uri)
Creates an input stream for the URI and returns it; it has the same effect as calling createInputStream(uri, null). |
java.io.InputStream |
createInputStream(URI uri,
java.util.Map<?,?> options)
Creates an input stream for the URI and returns it. |
java.io.OutputStream |
createOutputStream(URI uri)
Creates an output stream for the URI and returns it; it has the same effect as calling createOutputStream(uri, null). |
java.io.OutputStream |
createOutputStream(URI uri,
java.util.Map<?,?> options)
Creates an output stream for the URI and returns it. |
void |
delete(URI uri,
java.util.Map<?,?> options)
Deletes the contents of the given URI. |
boolean |
exists(URI uri,
java.util.Map<?,?> options)
Returns whether the given URI has contents. |
java.util.Map<java.lang.String,?> |
getAttributes(URI uri,
java.util.Map<?,?> options)
Returns a map from String attributes to their corresponding values representing information about various aspects of the URI's state. |
EList<ContentHandler> |
getContentHandlers()
Returns the list of ContentHandlers. |
protected ExtensibleURIConverterImpl.URIMap |
getInternalURIMap()
Returns the internal version of the URI map. |
URIHandler |
getURIHandler(URI uri)
Returns the first URI handler in the list of URI handlers which can handle the given URI. |
EList<URIHandler> |
getURIHandlers()
Returns the list of URIHandlers. |
java.util.Map<URI,URI> |
getURIMap()
Returns the map used for remapping a logical URI to a physical URI when normalizing. |
URI |
normalize(URI uri)
Returns the normalized form of the URI. |
void |
setAttributes(URI uri,
java.util.Map<java.lang.String,?> attributes,
java.util.Map<?,?> options)
Updates the map from String attributes to their corresponding values representing information about various aspects of the URI's state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ExtensibleURIConverterImpl.URIHandlerList uriHandlers
protected ExtensibleURIConverterImpl.ContentHandlerList contentHandlers
protected ExtensibleURIConverterImpl.URIMap uriMap
| Constructor Detail |
|---|
public ExtensibleURIConverterImpl()
public ExtensibleURIConverterImpl(java.util.Collection<URIHandler> uriHandlers,
java.util.Collection<ContentHandler> contentHandlers)
| Method Detail |
|---|
public EList<URIHandler> getURIHandlers()
URIConverterURIHandlers.
getURIHandlers in interface URIConverterURIHandlers.public URIHandler getURIHandler(URI uri)
URIConverterlist of URI handlers which can handle the given URI.
getURIHandler in interface URIConverteruri - the URI for which to find a handler.
public EList<ContentHandler> getContentHandlers()
URIConverterContentHandlers.
getContentHandlers in interface URIConverterContentHandlers.
public java.io.OutputStream createOutputStream(URI uri)
throws java.io.IOException
URIConvertercreateOutputStream(uri, null).
createOutputStream in interface URIConverterjava.io.IOException - if there is a problem obtaining an open output stream.URIConverter.createOutputStream(URI, Map)
public java.io.OutputStream createOutputStream(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
URIConverter
It normalizes the URI and uses that as the basis for further processing.
Special requirements, such as an Eclipse file refresh,
are handled by the default implementation.
createOutputStream in interface URIConverteruri - the URI for which to create the output stream.options - a map of options to influence the kind of stream that is returned; unrecognized options are ignored and null is permitted.
java.io.IOException - if there is a problem obtaining an open output stream.
public java.io.InputStream createInputStream(URI uri)
throws java.io.IOException
URIConvertercreateInputStream(uri, null).
createInputStream in interface URIConverteruri - the URI for which to create the input stream.
java.io.IOException - if there is a problem obtaining an open input stream.URIConverter.createInputStream(URI, Map)
public java.io.InputStream createInputStream(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
URIConverter
It normalizes the URI and uses that as the basis for further processing.
Special requirements, such as an Eclipse file refresh,
are handled by the default implementation.
createInputStream in interface URIConverteruri - the URI for which to create the input stream.options - a map of options to influence the kind of stream that is returned; unrecognized options are ignored and null is permitted.
java.io.IOException - if there is a problem obtaining an open input stream.
public void delete(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
URIConverter
delete in interface URIConverteruri - the URI to consider.options - options to influence how the contents are deleted, or null if there are no options.
java.io.IOException - if there is a problem deleting the contents.
public java.util.Map<java.lang.String,?> contentDescription(URI uri,
java.util.Map<?,?> options)
throws java.io.IOException
URIConvertercontent handler for more details.
contentDescription in interface URIConverteruri - the URI to consider.options - options to influence how the content description is determined, or null if there are no options.
java.io.IOException - if there is a problem accessing the contents.ContentHandler.contentDescription(URI, InputStream, Map, Map)
public boolean exists(URI uri,
java.util.Map<?,?> options)
URIConverterexists
it will be possible to create an input stream.
exists in interface URIConverteruri - the URI to consider.options - options to influence how the existence determined, or null if there are no options.
public java.util.Map<java.lang.String,?> getAttributes(URI uri,
java.util.Map<?,?> options)
URIConverterrequested attributes option can be used to specify which properties to fetch;
without that option, all supported attributes will be fetched.
If the URI doesn't not support any particular attribute, an entry for that attribute will not be appear in the result.
getAttributes in interface URIConverteruri - the URI to consider.options - options to influence how the attributes are determined, or null if there are no options.
public void setAttributes(URI uri,
java.util.Map<java.lang.String,?> attributes,
java.util.Map<?,?> options)
throws java.io.IOException
URIConverter
setAttributes in interface URIConverteruri - the URI to consider.attributes - the new values for the attributes.options - options to influence how the attributes are updated, or null if there are no options.
java.io.IOException - if there is a problem updating the attributes.public URI normalize(URI uri)
This implementation does precisely and only the typical thing.
It calls itself recursively so that mapped chains are followed.
normalize in interface URIConverteruri - the URI to normalize.
EcorePlugin.getPlatformResourceMap()public java.util.Map<URI,URI> getURIMap()
URIConverternormalizing.
An implementation will typically also delegate to the global map,
so registrations made in this map are local to this URI converter,
i.e., they augment or override those of the global map.
The map generally specifies instance to instance mapping,
except for the case that both the key URI and the value URI end with "/",
which specifies a folder to folder mapping.
A folder mapping will remap any URI that has the key as its prefix,
e.g., if the map contains:
http://www.example.com/ -> platform:/resource/example/then the URI
http://www.example.com/a/b/c.dwill map to
platform:/resource/example/a/b/c.dA matching instance mapping is considered first. If there isn't one, the folder mappings are considered starting with the
longest prefix.
getURIMap in interface URIConverterURIConverter.normalize(URI),
URIConverter.URI_MAPprotected ExtensibleURIConverterImpl.URIMap getInternalURIMap()
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||