|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Recognizer
interface provides the API for recognizing
data types from specific urls.
Data model frameworks can register their own recognizer with the
NodeFactory
.
NodeFactory
Method Summary | |
boolean |
canConvert(java.net.URL oldURL,
java.net.URL newURL)
Check if the old URL can be converted to the new
URL . |
Node |
create(java.net.URL url,
java.lang.Class type)
Creates an instance of the design-time node associated with the specified URL . |
java.lang.Class |
recognize(java.net.URL url)
Gets the Class of the data item associated with the
specified URL . |
java.net.URL |
validate(java.net.URL newURL,
java.net.URL oldURL)
Validate the specified new name. |
Method Detail |
public java.lang.Class recognize(java.net.URL url)
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 create(URL, Class)
method
which will create the design-time node.
url
- unique URL
identifying the document.
Class
.public Node create(java.net.URL url, java.lang.Class type) throws java.lang.IllegalAccessException, java.lang.InstantiationException
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.
url
- unique URL
identifying the document.type
- the data Class
.
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.net.URL validate(java.net.URL newURL, java.net.URL oldURL) throws RecognizerException
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.
newURL
- 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.public boolean canConvert(java.net.URL oldURL, java.net.URL newURL)
URL
can be converted to the new
URL
. This method is called on the new URL
's
Recognizer
. It is called when a Node
is being
renamed and the new name causes a Node
type conversion.
If the call to canConvert(URL, URL)
returns
true
, the Node
conversion will go through,
otherwise, it will not.
oldURL
- the url of the node being renamed.newURL
- the new url for the node.
|
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.