org.pf.tools.cda.core.classpath.eclipse
Class EclipseClasspathEntry

java.lang.Object
  extended by org.pf.tools.cda.core.classpath.eclipse.EclipseClasspathEntry

public class EclipseClasspathEntry
extends java.lang.Object

Holds one classpath entry from an Eclipse .classpath file.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
EclipseClasspathEntry(java.io.File projectDir, java.lang.String type)
          Initialize the new instance with its type.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns true if the given object is the same as this one
 java.lang.String getAbsolutePath()
           
 java.lang.String getPath()
          Returns the path (without resolved variable) of this entry
 java.lang.String getProjectPath()
           
 java.lang.String getSourcePath()
          Returns the path to the corresponding source code of this entry
 int hashCode()
          Returns the hash code
 boolean isContainerType()
          Returns true if this classpath entry is is of kind="con"
 boolean isExported()
          Returns true if this entry is visible to depending projects
 boolean isLibraryType()
          Returns true if this classpath entry is is of kind="lib"
 boolean isOutputType()
          Returns true if this classpath entry is is of kind="output"
 boolean isProjectReference()
          Returns true if this entry refers to another project in the same workspace
 boolean isRelativeToWorkspace()
          Returns true if this entry refers to a file or directory in a different project of the same workspace.
 boolean isSourceType()
          Returns true if this classpath entry is is of kind="src"
 boolean isVariableType()
          Returns true if this classpath entry is is of kind="var"
 boolean replaceVariable(java.util.Properties variables)
          Replaces the variable in the path with the corresponding value from the variable in the given variables pool.
 void setExported(boolean newValue)
          Sets whether this entry is exported to be visible to depening projects
 void setPath(java.lang.String newValue)
          Sets the path (without resolved variable) of this entry
 void setProjectPath(java.lang.String newValue)
           
 void setSourcePath(java.lang.String newValue)
          Sets the path to the corresponding source code of this entry
 java.lang.String toString()
          Returns the string representation
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EclipseClasspathEntry

public EclipseClasspathEntry(java.io.File projectDir,
                             java.lang.String type)
Initialize the new instance with its type.

Parameters:
type - The type as it is defined by the XML attribute "kind" of a classpathentry tag in .classpath
Method Detail

getProjectPath

public java.lang.String getProjectPath()

setProjectPath

public void setProjectPath(java.lang.String newValue)

getPath

public java.lang.String getPath()
Returns the path (without resolved variable) of this entry


setPath

public void setPath(java.lang.String newValue)
Sets the path (without resolved variable) of this entry


getSourcePath

public java.lang.String getSourcePath()
Returns the path to the corresponding source code of this entry


setSourcePath

public void setSourcePath(java.lang.String newValue)
Sets the path to the corresponding source code of this entry


setExported

public void setExported(boolean newValue)
Sets whether this entry is exported to be visible to depening projects


getAbsolutePath

public java.lang.String getAbsolutePath()

isSourceType

public boolean isSourceType()
Returns true if this classpath entry is is of kind="src"


isProjectReference

public boolean isProjectReference()
Returns true if this entry refers to another project in the same workspace


isRelativeToWorkspace

public boolean isRelativeToWorkspace()
Returns true if this entry refers to a file or directory in a different project of the same workspace.


isVariableType

public boolean isVariableType()
Returns true if this classpath entry is is of kind="var"


isOutputType

public boolean isOutputType()
Returns true if this classpath entry is is of kind="output"


isLibraryType

public boolean isLibraryType()
Returns true if this classpath entry is is of kind="lib"


isContainerType

public boolean isContainerType()
Returns true if this classpath entry is is of kind="con"


isExported

public boolean isExported()
Returns true if this entry is visible to depending projects


replaceVariable

public boolean replaceVariable(java.util.Properties variables)
Replaces the variable in the path with the corresponding value from the variable in the given variables pool. Entries that are not of type "var" do othing but return false.

Parameters:
variables - The pool of variables
Returns:
true if the variable was replaced.

toString

public java.lang.String toString()
Returns the string representation

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Returns true if the given object is the same as this one

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns the hash code

Overrides:
hashCode in class java.lang.Object