|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.model.DefaultRecognizer oracle.ide.xml.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 dataClass)
Creates an instance of the design-time node associated 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 . |
java.util.Map |
getExtensionToClassMap()
|
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 |
mapExtensionToClass(java.lang.String extension,
java.lang.Class cls)
Maps the specified file extension 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 |
mapRootElementToDataClass(java.lang.String rootElem,
java.lang.Class cls)
|
java.lang.Class |
recognize(java.net.URL url)
Gets the Class of the data item associated with the
specified URL . |
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 oracle.ide.model.DefaultRecognizer |
canConvert, clearExtensionToClassMap, getClassForExtension, getDocumentInfo, getValidConversions, registerConversion, registerDocumentInfo, sanitizeExtension, sanitizeExtensionAsString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
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 mapExtensionToClass(java.lang.String extension, 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 mapNamespaceElemToClass(java.lang.String namespaceURI, java.lang.String localElemName, java.lang.Class cls)
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.
NodeInfo
public 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)
Recognizer
Class
of the data item associated with the
specified URL
. Implementations must return
null
if the URL
is not recognized. The
Class
returned must be the data model class. This
value is passed to the Recognizer.create(URL, Class)
method
which will create the design-time node.
recognize
in interface Recognizer
recognize
in class DefaultRecognizer
public Node create(java.net.URL url, java.lang.Class dataClass) throws java.lang.IllegalAccessException, java.lang.InstantiationException
Recognizer
URL
. This method is called by the
NodeFactory
. This method must return a Node
instance. The type
parameter specifies the
Class
of the data object.
create
in interface Recognizer
create
in class DefaultRecognizer
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.net.URL validate(java.net.URL newURL, java.net.URL oldURL) throws RecognizerException
Recognizer
null
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 interface Recognizer
validate
in class DefaultRecognizer
RecognizerException
public java.util.Map getExtensionToClassMap()
getExtensionToClassMap
in class DefaultRecognizer
public static void mapRootElementToDataClass(java.lang.String rootElem, java.lang.Class cls)
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.