org.jupe.source.java
Class JavaSource

java.lang.Object
  extended by org.jupe.source.java.JavaSource
All Implemented Interfaces:
ISource

public class JavaSource
extends java.lang.Object
implements ISource

Author:
Michael Pradel

Field Summary
static java.lang.String javaSourceID
           
 
Constructor Summary
JavaSource(org.eclipse.core.resources.IProject project)
           
 
Method Summary
 void checkType(java.lang.String absoluteName)
          Causes a propagation of a type from the source to the UML2 model (if it doesn't already exist there).
 org.eclipse.core.resources.IFile getClassifierFromSource(java.lang.String absoluteName)
          Checks if the given classifier exists in the source code.
 org.eclipse.core.resources.IFolder getPackageFromSource(java.lang.String absoluteName)
          Checks if the given package exists in the source code.
 org.eclipse.jdt.core.IPackageFragmentRoot getSourceFolder()
          Get the java source folder where code for the current project gets generation into.
 boolean isStringType(java.lang.String absoluteName)
          Checks if the given absolute name of a type corresponds to the a String in this language (e.g. java.lang.String in Java).
 java.util.List<ITypeContentProposal> resolveType(java.lang.String contents, int position)
          Searches for possible resolutions of the given String to a type name that is in the projects classpath.
 boolean typeExists(java.lang.String absoluteName)
          Checks whether a type exists in the source code or included libraries.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

javaSourceID

public static java.lang.String javaSourceID
Constructor Detail

JavaSource

public JavaSource(org.eclipse.core.resources.IProject project)
Method Detail

getPackageFromSource

public org.eclipse.core.resources.IFolder getPackageFromSource(java.lang.String absoluteName)
Description copied from interface: ISource
Checks if the given package exists in the source code.

Specified by:
getPackageFromSource in interface ISource
Parameters:
absoluteName - The absolute name if the package..
Returns:
The folder that contains the package or null if it doesn't exist in the source.

getClassifierFromSource

public org.eclipse.core.resources.IFile getClassifierFromSource(java.lang.String absoluteName)
Description copied from interface: ISource
Checks if the given classifier exists in the source code.

Specified by:
getClassifierFromSource in interface ISource
Parameters:
absoluteName - The absolute name if the classifier.
Returns:
The file that contains the classifier or null if it doesn't exist in the source.

checkType

public void checkType(java.lang.String absoluteName)
Description copied from interface: ISource
Causes a propagation of a type from the source to the UML2 model (if it doesn't already exist there). After calling this method for any type in the source or included libraries, it will be included in the project's UML2 model.

Specified by:
checkType in interface ISource
Parameters:
absoluteName - The absolute name of the type that should be propagated to the UML2 model.

getSourceFolder

public org.eclipse.jdt.core.IPackageFragmentRoot getSourceFolder()
Get the java source folder where code for the current project gets generation into.

Returns:
The source folder for code generation.

typeExists

public boolean typeExists(java.lang.String absoluteName)
Description copied from interface: ISource
Checks whether a type exists in the source code or included libraries.

Specified by:
typeExists in interface ISource
Parameters:
absoluteName - The type that should be tested.
Returns:
True, if the given type exists in the source code or included libraries, false otherwise.

resolveType

public java.util.List<ITypeContentProposal> resolveType(java.lang.String contents,
                                                        int position)
Description copied from interface: ISource
Searches for possible resolutions of the given String to a type name that is in the projects classpath. Search is done in the source code and inlcuded libraries.

Specified by:
resolveType in interface ISource
Parameters:
contents - The beginning of a type name.
position - The current cursor position in the String.
Returns:
List of proposals (absolute names) of types in the source and included libraries that match the given String.

isStringType

public boolean isStringType(java.lang.String absoluteName)
Description copied from interface: ISource
Checks if the given absolute name of a type corresponds to the a String in this language (e.g. java.lang.String in Java).

Specified by:
isStringType in interface ISource
Parameters:
absoluteName - Absolute name of a type.
Returns:
True if it's String, false otherwise.