Extension SDK

oracle.jdeveloper.library
Class LegacyLibraryRecognizer

java.lang.Object
  extended byoracle.jdeveloper.library.LegacyLibraryRecognizer
All Implemented Interfaces:
Recognizer

public class LegacyLibraryRecognizer
extends java.lang.Object
implements Recognizer


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.
static Recognizer getInstance()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Recognizer getInstance()

recognize

public java.lang.Class recognize(java.net.URL url)
Description copied from interface: Recognizer
Gets the 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.

Specified by:
recognize in interface Recognizer
Parameters:
url - unique URL identifying the document.
Returns:
the data Class.

create

public Node create(java.net.URL url,
                   java.lang.Class type)
            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.
type - 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.

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.