|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.ecore.resource.impl.ContentHandlerImpl
public class ContentHandlerImpl
An implementation of a content handler.
Nested Class Summary | |
---|---|
static class |
ContentHandlerImpl.Describer
An implementation of a describer that delegates to a ContentHandler . |
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.ContentHandler |
---|
ContentHandler.ByteOrderMark, ContentHandler.Registry, ContentHandler.Validity |
Field Summary |
---|
Fields inherited from interface org.eclipse.emf.ecore.resource.ContentHandler |
---|
BYTE_ORDER_MARK_PROPERTY, CHARSET_PROPERTY, CONTENT_TYPE_PROPERTY, INVALID_CONTENT_DESCRIPTION, OPTION_REQUESTED_PROPERTIES, UNSPECIFIED_CONTENT_TYPE, VALIDITY_PROPERTY |
Constructor Summary | |
---|---|
ContentHandlerImpl()
Creates an instance. |
Method Summary | |
---|---|
boolean |
canHandle(URI uri)
This implementations always return true; clients are generally expected to override this. |
java.util.Map<java.lang.String,java.lang.Object> |
contentDescription(URI uri,
java.io.InputStream inputStream,
java.util.Map<?,?> options,
java.util.Map<java.lang.Object,java.lang.Object> context)
This base implementation handles looking up the ContentHandler.BYTE_ORDER_MARK_PROPERTY if that's a requested property . |
static java.util.Map<java.lang.String,java.lang.Object> |
createContentDescription(ContentHandler.Validity validity)
Creates a map with a single entry from ContentHandler.VALIDITY_PROPERTY to the given validity value. |
protected ContentHandler.ByteOrderMark |
getByteOrderMark(URI uri,
java.io.InputStream inputStream,
java.util.Map<?,?> options,
java.util.Map<java.lang.Object,java.lang.Object> context)
Returns the byte order marker at the start of the input stream. |
protected java.util.Set<java.lang.String> |
getRequestedProperties(java.util.Map<?,?> options)
Returns the value of ContentHandler.OPTION_REQUESTED_PROPERTIES in the options map. |
protected boolean |
isRequestedProperty(java.lang.String property,
java.util.Map<?,?> options)
Returns whether the named property is one requested in the options. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentHandlerImpl()
Method Detail |
---|
public static java.util.Map<java.lang.String,java.lang.Object> createContentDescription(ContentHandler.Validity validity)
ContentHandler.VALIDITY_PROPERTY
to the given validity value.
validity
- the value of the validity property.
ContentHandler.VALIDITY_PROPERTY
to the given validity value.protected java.util.Set<java.lang.String> getRequestedProperties(java.util.Map<?,?> options)
ContentHandler.OPTION_REQUESTED_PROPERTIES
in the options map.
options
- the options in which to look up the property.
ContentHandler.OPTION_REQUESTED_PROPERTIES
in the options map.protected boolean isRequestedProperty(java.lang.String property, java.util.Map<?,?> options)
property
- the property in question.options
- the options in which to look for the requested property.
getRequestedProperties(Map)
public boolean canHandle(URI uri)
canHandle
in interface ContentHandler
uri
- the URI in questions.
public java.util.Map<java.lang.String,java.lang.Object> contentDescription(URI uri, java.io.InputStream inputStream, java.util.Map<?,?> options, java.util.Map<java.lang.Object,java.lang.Object> context) throws java.io.IOException
ContentHandler.BYTE_ORDER_MARK_PROPERTY
if that's a requested property
.
contentDescription
in interface ContentHandler
uri
- the URI for which to determine the content description.inputStream
- the input stream associated with the given URI.options
- a map of options to direct what kind of description is needed.context
- a map of contextual information that content handlers use to store partially computed results.
java.io.IOException
- if there is a problem reading the stream.protected ContentHandler.ByteOrderMark getByteOrderMark(URI uri, java.io.InputStream inputStream, java.util.Map<?,?> options, java.util.Map<java.lang.Object,java.lang.Object> context) throws java.io.IOException
uri
- the URI of the input stream.inputStream
- the input stream to scan.options
- any options to influence the behavior; this base implementation ignores this.context
- the cache for fetching and storing a previous computation of the byte order marker; this base implementation caches ContentHandler.BYTE_ORDER_MARK_PROPERTY
.
java.io.IOException
|
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 |