Extension SDK

oracle.jdeveloper.library
Class JLibraryList

java.lang.Object
  extended byoracle.ide.model.DefaultDisplayable
      extended byoracle.ide.model.DefaultElement
          extended byoracle.ide.model.DefaultDocument
              extended byoracle.ide.model.DefaultNode
                  extended byoracle.ide.model.DataNode
                      extended byoracle.jdeveloper.library.JLibraryList
All Implemented Interfaces:
Category, Copyable, Data, Dirtyable, Displayable, Document, Element, Folder, LazyLoadable, LibraryList, Locatable, Node, Subject

public final class JLibraryList
extends DataNode
implements LibraryList


Field Summary
static java.lang.String NAMESPACE_URI
           
static java.lang.String ROOT_TAG
           
 
Fields inherited from class oracle.ide.model.DataNode
_objectStore
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Fields inherited from interface oracle.ide.model.Category
UNDEFINED
 
Constructor Summary
JLibraryList()
           
JLibraryList(JLibraryList list)
           
 
Method Summary
 boolean add(Element child)
          Appends a child Element to the end of the Folder.
 boolean canAdd(Element element)
          Other classes can call this method to determine whether the given Element can be added to the Folder.
 boolean canRemove(Element element)
          Other classes can call this method to determine whether the specified Element can be removed from this Folder.
 boolean containsChild(Element child)
          Returns true if the folder contains the specified child Element; returns false otherwise.
 java.lang.Object copyTo(java.lang.Object target)
          Copies the internal state of this object to the specified copy.
protected  void copyToImpl(JLibraryList copy)
           
protected  ObjectStore currentObjectStore()
           
 JDK findJDK(java.lang.String JDKName)
          Finds the J2SE definition that matches the specified name.
 JDK findJDK(VersionNumber num)
          Finds the J2SE definition that matches the specified version number.
 JLibrary findLibrary(java.lang.String libName)
          Finds the library that matches the specified name.
 java.lang.String findUniqueJDKName()
          Determines a unique name that can be used for a new J2SE definition.
 java.lang.String findUniqueLibraryName()
          Determines a unique name that can be used for a new library.
 java.util.Map getAliasMap()
           
 Attributes getAttributes()
          This method returns an Attributes object that encodes the attributes of the Element.
 java.util.Iterator getChildren()
          This method is part of the Element interface to provide a convenient way of getting an Iterator over any contained child Elements without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 JDK getDefaultJDK()
           
 java.util.List getJdkList()
          Retrieves the list of J2SE definitions contained in this LibraryList.
 java.util.List getLibraryList()
          Retrieves the list of Libraries contained in this LibraryList.
 java.lang.String getListName()
          Retrieves the name of this LibraryList.
static LibraryList getSystemLibraries()
          Deprecated. Use JLibraryManager.getSystemLibraries()
 boolean isBuiltIn()
           
 boolean isChildJDK(JDK jdk)
          Determines whether the specified J2SE definition is a child of this LibraryList.
 boolean isChildLibrary(JLibrary lib)
          Determines whether the specified Library is a child of this LibraryList.
 boolean isReadOnly()
          Returns true if the document is read-only.
 boolean isTransient()
          Whether this list is transient (not-persistent).
 boolean mayHaveChildren()
          This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 void open()
          Document interface method.
 boolean remove(Element child)
          Removes the specified child Element.
 void removeAll()
          Removes all children from the folder.
 java.lang.String resolveAlias(java.lang.String name)
          Resolves a name against the list of known aliases.
 void setAliasMap(java.util.Map aliasMap)
           
 void setBuiltIn(boolean isBuiltIn)
           
 void setJdkList(java.util.List jdks)
           
 void setLibraryList(java.util.List libs)
           
 void setListName(java.lang.String name)
           
 int size()
          Returns the current number of children in the folder.
 
Methods inherited from class oracle.ide.model.DataNode
close, getURL, reopen, save, setObjectStore
 
Methods inherited from class oracle.ide.model.DefaultNode
equalsImpl, getCategory, setURL
 
Methods inherited from class oracle.ide.model.DefaultDocument
attach, copyToImpl, createSubject, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, isDirty, isNew, isOpen, markDirty, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly
 
Methods inherited from class oracle.ide.model.DefaultElement
getData
 
Methods inherited from class oracle.ide.model.DefaultDisplayable
getIcon, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Data
getData
 
Methods inherited from interface oracle.ide.model.Displayable
getIcon, getLongLabel, getShortLabel, getToolTipText, toString
 
Methods inherited from interface oracle.ide.addin.Subject
attach, detach, notifyObservers
 
Methods inherited from interface oracle.ide.model.Dirtyable
isDirty, markDirty
 
Methods inherited from interface oracle.ide.model.Document
getInputStream, getTimestamp, isNew
 
Methods inherited from interface oracle.ide.model.LazyLoadable
isOpen
 

Field Detail

NAMESPACE_URI

public static final java.lang.String NAMESPACE_URI

ROOT_TAG

public static final java.lang.String ROOT_TAG
See Also:
Constant Field Values
Constructor Detail

JLibraryList

public JLibraryList()

JLibraryList

public JLibraryList(JLibraryList list)
Method Detail

getSystemLibraries

public static LibraryList getSystemLibraries()
Deprecated. Use JLibraryManager.getSystemLibraries()


copyTo

public java.lang.Object copyTo(java.lang.Object target)
Description copied from interface: Copyable
Copies the internal state of this object to the specified copy. If copy is null, then this method should create a new instance of this class and proceed to copy the internal state to the newly created object. Generally, only the persistent state of the object should be copied, but whether or not it is appropriate to copy transient properties is at the discretion of the individual implementor.

Regardless of whether the copy occurs to an existing object or to a newly created object, the return value is object to which this object's state was copied.

There is a standard implementation pattern for the copyTo method that helps avoid problems that arise when a Copyable object is subclassed. The pattern is:

public Object copyTo( Object target )
{
final <this_class> copy =
target != null ? (<this_class>) target : new <this_class>();
copyToImpl( copy );
return copy;
} protected final void copyToImpl( <this_class> copy ) { super.copyToImpl( copy ); // if necessary // put code here for copying the properties of <this_class> }
The parameter passed into the copyToImpl method is the same type of this class. The responsibility of copyToImpl is to copy the state of this class through direct access of the fields. The copyToImpl method should not use getters and setters since these may be overridden, causing the state of this class to be incompletely copied.

Specified by:
copyTo in interface Copyable
Parameters:
target - The target object to which the state of this object should be copied. If target is null, then the copyTo method will return a new instance of this class.
Returns:
The object to which the state of this object was copied. If the target was non-null, then the return value is the same as the target object that was passed in; otherwise, the return value is a new instance of this class.

copyToImpl

protected final void copyToImpl(JLibraryList copy)

currentObjectStore

protected ObjectStore currentObjectStore()
Overrides:
currentObjectStore in class DataNode

setLibraryList

public void setLibraryList(java.util.List libs)

getLibraryList

public java.util.List getLibraryList()
Description copied from interface: LibraryList
Retrieves the list of Libraries contained in this LibraryList.

Specified by:
getLibraryList in interface LibraryList

setJdkList

public void setJdkList(java.util.List jdks)

getJdkList

public java.util.List getJdkList()
Description copied from interface: LibraryList
Retrieves the list of J2SE definitions contained in this LibraryList.

Specified by:
getJdkList in interface LibraryList

findUniqueJDKName

public java.lang.String findUniqueJDKName()
Description copied from interface: LibraryList
Determines a unique name that can be used for a new J2SE definition.

Specified by:
findUniqueJDKName in interface LibraryList

findJDK

public JDK findJDK(java.lang.String JDKName)
Description copied from interface: LibraryList
Finds the J2SE definition that matches the specified name.

Specified by:
findJDK in interface LibraryList
Parameters:
JDKName - the name of the J2SE definition
Returns:
the JDK representing the J2SE definition.

findJDK

public JDK findJDK(VersionNumber num)
Description copied from interface: LibraryList
Finds the J2SE definition that matches the specified version number.

Specified by:
findJDK in interface LibraryList
Parameters:
num - the VersionNumber of the desired J2SE defintion.
Returns:
the JDK representing the J2SE definition.

findUniqueLibraryName

public java.lang.String findUniqueLibraryName()
Description copied from interface: LibraryList
Determines a unique name that can be used for a new library.

Specified by:
findUniqueLibraryName in interface LibraryList

findLibrary

public JLibrary findLibrary(java.lang.String libName)
Description copied from interface: LibraryList
Finds the library that matches the specified name.

Specified by:
findLibrary in interface LibraryList

isChildLibrary

public boolean isChildLibrary(JLibrary lib)
Description copied from interface: LibraryList
Determines whether the specified Library is a child of this LibraryList.

Specified by:
isChildLibrary in interface LibraryList

isChildJDK

public boolean isChildJDK(JDK jdk)
Description copied from interface: LibraryList
Determines whether the specified J2SE definition is a child of this LibraryList.

Specified by:
isChildJDK in interface LibraryList

isTransient

public boolean isTransient()
Description copied from interface: LibraryList
Whether this list is transient (not-persistent). Transient lists cannot have new children created by the user

Specified by:
isTransient in interface LibraryList

getAliasMap

public java.util.Map getAliasMap()

setAliasMap

public void setAliasMap(java.util.Map aliasMap)

resolveAlias

public java.lang.String resolveAlias(java.lang.String name)
Resolves a name against the list of known aliases. If the specified name is not a know alias, it is returned.

Parameters:
name - the alias name
Returns:
the resolved name of the library.

setListName

public void setListName(java.lang.String name)

getListName

public java.lang.String getListName()
                             throws TransientMarker
Description copied from interface: LibraryList
Retrieves the name of this LibraryList.

Specified by:
getListName in interface LibraryList
Throws:
TransientMarker

setBuiltIn

public void setBuiltIn(boolean isBuiltIn)

isBuiltIn

public boolean isBuiltIn()
                  throws TransientMarker
Throws:
TransientMarker

getDefaultJDK

public JDK getDefaultJDK()

getChildren

public java.util.Iterator getChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of getting an Iterator over any contained child Elements without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return null from this method. An implementation of Element that could represent a non-leaf in a tree structure should return either an Iterator over the child Elements or null if there are no children.

Specified by:
getChildren in interface Element
Overrides:
getChildren in class DefaultElement
See Also:
Element.getChildren()

mayHaveChildren

public boolean mayHaveChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return false from this method. An implementation of Element that could represent a non-leaf in a tree structure should return true from this method, even if it does not currently contain any children.

Specified by:
mayHaveChildren in interface Element
Overrides:
mayHaveChildren in class DefaultElement
See Also:
Element.mayHaveChildren()

canRemove

public boolean canRemove(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the specified Element can be removed from this Folder.

Specified by:
canRemove in interface Folder
Parameters:
element - the Element that is about to be removed from this Folder.
Returns:
true if the specified Element can be removed from this Folder; false if the Element cannot be removed.

add

public boolean add(Element child)
Description copied from interface: Folder
Appends a child Element to the end of the Folder.

Specified by:
add in interface Folder

canAdd

public boolean canAdd(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the given Element can be added to the Folder.

Specified by:
canAdd in interface Folder
Parameters:
element - the Element that is about to be added to this Folder.
Returns:
true if the specified Element can be added to this Folder; false if the Element cannot be added.

removeAll

public void removeAll()
Description copied from interface: Folder
Removes all children from the folder.

Specified by:
removeAll in interface Folder

size

public int size()
Description copied from interface: Folder
Returns the current number of children in the folder.

Specified by:
size in interface Folder

containsChild

public boolean containsChild(Element child)
Description copied from interface: Folder
Returns true if the folder contains the specified child Element; returns false otherwise.

Specified by:
containsChild in interface Folder

remove

public boolean remove(Element child)
Description copied from interface: Folder
Removes the specified child Element. If the child object appears more than once, only the first instance is removed.

Specified by:
remove in interface Folder
Parameters:
child - The child object to remove.

getAttributes

public Attributes getAttributes()
Description copied from interface: Element
This method returns an Attributes object that encodes the attributes of the Element. Changing the attribute settings on the return object changes the element attributes. Subclasses should use their super class attributes object to define their own attributes. This allows subclasses to inherit their super class attributes. If a subclass does not wish to inherit attributes, they should first call getAttributes().clear() and define new attributes.

Specified by:
getAttributes in interface Element
Overrides:
getAttributes in class DefaultElement
See Also:
Element.getAttributes()

isReadOnly

public boolean isReadOnly()
Description copied from interface: Document
Returns true if the document is read-only.

Specified by:
isReadOnly in interface Document
Overrides:
isReadOnly in class DefaultDocument
See Also:
Document.isReadOnly()

open

public void open()
          throws java.io.IOException
Description copied from class: DataNode
Document interface method. This method uses ObjectStore to unmarshal the file into a JavaBean instance.

Specified by:
open in interface Document
Overrides:
open in class DataNode
Throws:
java.io.IOException
See Also:
ObjectStore

Extension SDK

 

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