oracle.ide.model
Class AbstractElementRecognizer
java.lang.Object
oracle.ide.model.AbstractElementRecognizer
- All Implemented Interfaces:
- ElementRecognizer, Recognizer
- Direct Known Subclasses:
- CmtElementRecognizer
- public abstract class AbstractElementRecognizer
- extends java.lang.Object
- implements ElementRecognizer
The AbstractElementRecognizer
class.
- See Also:
ElementRecognizer
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 clazz)
Creates an instance of the design-time node associated with the specified URL . |
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 |
AbstractElementRecognizer
public AbstractElementRecognizer()
create
public Node create(java.net.URL url,
java.lang.Class clazz)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
- Description copied from interface:
Recognizer
- Creates an instance of the design-time node associated with the specified
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.
-
- Specified by:
create
in interface Recognizer
-
- Parameters:
url
- unique URL
identifying the document.
clazz
- the data Class
.
- Returns:
- Design-time node.
- Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
validate
public java.net.URL validate(java.net.URL newURL,
java.net.URL oldURL)
throws RecognizerException
- Description copied from interface:
Recognizer
- Validate the specified new name. Returns
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.
-
- Specified by:
validate
in interface Recognizer
-
- Parameters:
newURL
- the new URL
to validate.
oldURL
- the old URL
used as the validation base.
- Returns:
- the validated
URL
or null
if the name does not validate.
- Throws:
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.
canConvert
public boolean canConvert(java.net.URL oldURL,
java.net.URL newURL)
- Description copied from interface:
Recognizer
- Check if the old
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 Recognizer.canConvert(URL, URL)
returns true
, the Node
conversion will go through, otherwise, it will not.
-
- Specified by:
canConvert
in interface Recognizer
-
- Parameters:
oldURL
- the url of the node being renamed.
newURL
- the new url for the node.
- Returns:
- true if conversion is possible.
Copyright © 1997, 2004, Oracle. All rights reserved.