|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.ide.model.Recognizer
oracle.ide.xml.XMLRecognizer
public final class XMLRecognizer
The XMLRecognizer is the default Recognizer
implementation used in the IDE. It contains support for recognizing
an XML document through a variety of mechanisms.
| Method Summary | |
|---|---|
Node |
create(java.net.URL url,
java.lang.Class nodeType)
This method creates a Node instance of the specified
type with the specified URL. |
static NodeInfo |
findNodeInfo(java.lang.Class dataClass)
This method finds a NodeInfo instance that is associated
with a particular data Class. |
static XMLRecognizer |
getInstance()
|
static void |
mapDoctypeToClass(java.lang.String publicId,
java.lang.String systemId,
java.lang.Class cls)
Maps the specified public ID and system ID (from the XML doctype) to the specified data class. |
static void |
mapNamespaceElemToClass(java.lang.String namespaceURI,
java.lang.String localElemName,
java.lang.Class cls)
Maps the specified namespace element (a combination of the XML namespace URI with local element name) to the specified data class. |
static void |
mapRootElementToClass(java.lang.String rootElem,
java.lang.Class cls)
Maps the specified file extension to the specified
data class. |
static void |
mapSchemaInstanceToClass(java.lang.String schemaLocationURI,
java.lang.String rootElemLocalName,
java.lang.Class nodeType)
Maps the specified schema location URI and root element's local name to the specified data class. |
java.lang.Class |
recognize(java.net.URL url)
This method implements the fundamental responsibility of a Recognizer -- to map a URL to a Node type. |
static void |
registerNodeInfo(NodeInfo info)
Uses the specified NodeInfo to register recognizer
behavior. |
static void |
treatExtensionAsXML(java.lang.String extension)
Registers the specified extension as one that
corresponds to an XML file. |
static void |
treatExtensionAsXML(java.lang.String extension,
NodeInfoLoader loader)
Registers the specified extension as one that
corresponds to an XML file. |
java.net.URL |
validate(java.net.URL newURL,
java.net.URL oldURL)
Validate the specified new name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static XMLRecognizer getInstance()
public static void treatExtensionAsXML(java.lang.String extension)
extension as one that
corresponds to an XML file. The XMLRecognizer only attempts
to find a data class for an XML file if the URL for the file
has an extension that is treated as XML.
The extension passed in is allowed to contain
or omit the leading "."; if it is omitted, it will be added
automatically.
public static void treatExtensionAsXML(java.lang.String extension,
NodeInfoLoader loader)
extension as one that
corresponds to an XML file. The NodeInfoLoader will be
used to trigger the lazy loading of NodeInfo objects if
an URL with the specified extension is
recognized by XMLRecognizer.
The loader can be null, which means
that there is no NodeInfoLoader that needs to be invoked
for the specified extension.
public static void mapNamespaceElemToClass(java.lang.String namespaceURI,
java.lang.String localElemName,
java.lang.Class cls)
public static void mapSchemaInstanceToClass(java.lang.String schemaLocationURI,
java.lang.String rootElemLocalName,
java.lang.Class nodeType)
public static void mapDoctypeToClass(java.lang.String publicId,
java.lang.String systemId,
java.lang.Class cls)
public static void mapRootElementToClass(java.lang.String rootElem,
java.lang.Class cls)
extension to the specified
data class.
The specified extension is allowed to contain or
omit the leading "."; if omitted, it will be added automatically.
public static void registerNodeInfo(NodeInfo info)
NodeInfo to register recognizer
behavior.
NodeInfopublic static NodeInfo findNodeInfo(java.lang.Class dataClass)
NodeInfo instance that is associated
with a particular data Class.
dataClass - The data Class.
NodeInfo associated with the data class or
null if no NodeInfo is found.public java.lang.Class recognize(java.net.URL url)
RecognizerNode type. Efficient
implementation of this method is essential for the IDE's
performance. In particular, I/O operations should be avoided or
deferred as much as possible. If a Recognizer does not recognize
a particular URL, this method must return null. The
returned Class representing the Node type is later passed to the
Recognizer.create(URL,Class) method which creates the Node
instance.
recognize in class Recognizerurl - unique URL identifying the document.
Node type as a Class object.
public Node create(java.net.URL url,
java.lang.Class nodeType)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
RecognizerNode instance of the specified
type with the specified URL. If the type is
null, then the returned Node is also
null.
create in class Recognizerurl - unique URL identifying the document.nodeType - the type of the Node. The specified
Class object must represent a type of Node, or else
a ClassCastException will occur.
Node.
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.net.URL validate(java.net.URL newURL,
java.net.URL oldURL)
throws RecognizerException
Recognizernull if the
name does not validate. This method may modify the URL to
make it valid, such as adding a file extension. The old
URL is used as the validation base. For example, if the
new URL does not have the correct file extension, the old
URL extension may be added to the new URL during
the validation process.
validate in class RecognizernewURL - the new URL to validate.oldURL - the old URL used as the validation base.
URL or null if the
name does not validate.
RecognizerException - if validation fails. The reason
why validation failed is in the exception's message. The message
should be suitably formatted so that it can be displayed to the
user.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||