|
Eclipse JDT 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jdt.ui.jarpackager.JarPackageData
Model for a JAR package. Describes a JAR package including a bunch of useful options to generate a JAR file with a JAR writer. Clients may subclass.
JarWriter
Constructor Summary | |
JarPackageData()
|
Method Summary | |
boolean |
allowOverwrite()
Tells whether files can be overwritten without warning. |
boolean |
areClassFilesExported()
Tells whether class files and resources are exported. |
boolean |
areErrorsExported()
Answers if compilation units with errors are exported. |
boolean |
areJavaFilesExported()
Tells whether java files and resources are exported. |
IJarDescriptionReader |
createJarDescriptionReader(InputStream inputStream)
Creates and returns a JAR package data description reader for this JAR package data object. |
IJarDescriptionWriter |
createJarDescriptionWriter(OutputStream outputStream)
Creates and returns a JAR package data description writer for this JAR package data object. |
IJarExportRunnable |
createJarExportRunnable(JarPackageData[] jarPackagesData,
Shell parent)
Creates and returns a JarExportRunnable for a list of JAR package data objects. |
IJarExportRunnable |
createJarExportRunnable(Shell parent)
Creates and returns a JarExportRunnable. |
JarWriter |
createJarWriter(Shell parent)
Creates and returns a JarWriter for this JAR package. |
boolean |
exportWarnings()
Answers if compilation units with warnings are exported. |
IFile[] |
findClassfilesFor(IFile javaFile)
Finds the class files for the given java file and returns them. |
String |
getComment()
Returns the JAR's comment. |
IFile |
getDescriptionFile()
Gets the description file (as workspace resource). |
IPath |
getDescriptionLocation()
Returns the location of file containing the description of a JAR. |
Object[] |
getElements()
Returns the elements which will be exported. |
IPath |
getJarLocation()
Gets the location of the JAR file. |
IFile |
getManifestFile()
Gets the manifest file (as workspace resource). |
IPath |
getManifestLocation()
Returns the location of a user-defined manifest file. |
IType |
getManifestMainClass()
Gets the manifest's main class. |
IManifestProvider |
getManifestProvider()
Gets the manifest provider for this JAR package. |
String |
getManifestVersion()
Gets the manifest version. |
IPackageFragment[] |
getPackagesToSeal()
Gets the packages which should be sealed. |
IPackageFragment[] |
getPackagesToUnseal()
Gets the packages which should explicitly be unsealed. |
boolean |
isBuildingIfNeeded()
Answers if a build should be performed before exporting files. |
boolean |
isCompressed()
Tells whether the JAR is compressed or not. |
boolean |
isDescriptionSaved()
Tells whether a description of this JAR package must be saved to a file by a JAR description writer during the export operation. |
boolean |
isJarSealed()
Answers whether the JAR itself is sealed. |
boolean |
isMainClassValid(IRunnableContext context)
Tells whether the specified manifest main class is valid. |
boolean |
isManifestAccessible()
Tells whether a manifest is available. |
boolean |
isManifestGenerated()
Tells whether the manifest file must be generated. |
boolean |
isManifestReused()
Tells whether a previously generated manifest should be reused. |
boolean |
isManifestSaved()
Tells whether the manifest file must be saved to the specified file during the export operation. |
boolean |
isValid()
Tells whether this JAR package data can be used to generate a valid JAR. |
boolean |
logErrors()
Deprecated. will be removed in final 2.0 |
boolean |
logWarnings()
Deprecated. will be removed in final 2.0 |
void |
setBuildIfNeeded(boolean fBuildIfNeeded)
Set if a build should be performed before exporting files. |
void |
setComment(String comment)
Sets the JAR's comment. |
void |
setCompress(boolean state)
Set whether the JAR is compressed or not. |
void |
setDescriptionLocation(IPath descriptionLocation)
Set the location of the JAR description file. |
void |
setElements(Object[] elements)
Set the elements which will be exported. |
void |
setExportClassFiles(boolean state)
Set option to export class files and resources. |
void |
setExportErrors(boolean exportErrors)
Set if compilation units with errors are exported. |
void |
setExportJavaFiles(boolean state)
Set the option to export Java source and resources. |
void |
setExportWarnings(boolean exportWarnings)
Set if compilation units with warnings are exported. |
void |
setGenerateManifest(boolean state)
Set whether a manifest must be generated or not. |
void |
setJarLocation(IPath jarLocation)
Set the JAR file location. |
void |
setLogErrors(boolean logErrors)
Deprecated. will be removed in final 2.0 |
void |
setLogWarnings(boolean logWarnings)
Deprecated. will be removed in final 2.0 |
void |
setManifestLocation(IPath manifestLocation)
Set the location of a user-defined manifest file. |
void |
setManifestMainClass(IType manifestMainClass)
Set the manifest's main class. |
void |
setManifestProvider(IManifestProvider manifestProvider)
Set the manifest provider. |
void |
setManifestVersion(String manifestVersion)
Set the manifest version. |
void |
setOverwrite(boolean state)
Set whether files can be overwritten without warning. |
void |
setPackagesToSeal(IPackageFragment[] packagesToSeal)
Set the packages which should be sealed. |
void |
setPackagesToUnseal(IPackageFragment[] packagesToUnseal)
Set the packages which should explicitly be unsealed. |
void |
setReuseManifest(boolean state)
Set whether a previously generated manifest should be reused. |
void |
setSaveDescription(boolean state)
Set whether a description of this JAR package must be saved to a file by a JAR description writer during the export operation. |
void |
setSaveManifest(boolean state)
Set whether the manifest file must be saved during export operation or not. |
void |
setSealJar(boolean sealJar)
Set whether the JAR itself is sealed. |
void |
setUsesManifest(boolean state)
Set whether a manifest must be included in the JAR. |
void |
setUseSourceFolderHierarchy(boolean state)
Set the option to export the source folder hierarchy. |
boolean |
usesManifest()
Answers whether a manifest must be included in the JAR. |
boolean |
useSourceFolderHierarchy()
Tells whether the source folder hierarchy is used. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JarPackageData()
Method Detail |
public boolean isCompressed()
true
if the JAR is compressedpublic void setCompress(boolean state)
state
- a boolean indicating the new statepublic boolean allowOverwrite()
true
if files can be overwritten without warningpublic void setOverwrite(boolean state)
state
- a boolean indicating the new statepublic boolean areClassFilesExported()
true
if class files and resources are exportedpublic void setExportClassFiles(boolean state)
state
- a boolean indicating the new statepublic boolean areJavaFilesExported()
true
if java files and resources are exportedpublic void setExportJavaFiles(boolean state)
state
- the new statepublic boolean useSourceFolderHierarchy()
Using the source folder hierarchy only makes sense if java files are but class files aren't exported.
true
if source folder hierarchy is usedpublic void setUseSourceFolderHierarchy(boolean state)
state
- the new statepublic IPath getJarLocation()
public void setJarLocation(IPath jarLocation)
jarLocation
- a path denoting the location of the JAR filepublic boolean isManifestGenerated()
true
if the manifest has to be generatedpublic void setGenerateManifest(boolean state)
state
- the new statepublic boolean isManifestSaved()
true
if the manifest must be savedgetManifestLocation()
public void setSaveManifest(boolean state)
state
- the new stategetManifestLocation()
public boolean isManifestReused()
true
if the generated manifest will be reused when regenerating this JAR,
false
if the manifest has to be regeneratedpublic void setReuseManifest(boolean state)
state
- the new statepublic IPath getManifestLocation()
null
if none is specifiedpublic void setManifestLocation(IPath manifestLocation)
manifestLocation
- the path of the user-define manifest locationpublic IFile getManifestFile()
public String getManifestVersion()
public void setManifestVersion(String manifestVersion)
manifestVersion
- the string which contains the manifest versionpublic boolean usesManifest()
true
if a manifest has to be includedpublic void setUsesManifest(boolean state)
state
- the new statepublic IManifestProvider getManifestProvider()
public void setManifestProvider(IManifestProvider manifestProvider)
manifestProvider
- the ManifestProvider to setpublic boolean isJarSealed()
This option should only be considered when the manifest file is generated.
true
if the JAR must be seleadisManifestGenerated()
public void setSealJar(boolean sealJar)
This option should only be considered when the manifest file is generated.
sealJar
- true
if the JAR must be seleadisManifestGenerated()
public void setPackagesToSeal(IPackageFragment[] packagesToSeal)
This should only be used if the JAR itself is not sealed.
packagesToSeal
- an array of IPackageFragment
to sealpublic IPackageFragment[] getPackagesToSeal()
This should only be used if the JAR itself is not sealed.
IPackageFragment
public IPackageFragment[] getPackagesToUnseal()
This should only be used if the JAR itself is sealed.
IPackageFragment
public void setPackagesToUnseal(IPackageFragment[] packagesToUnseal)
This should only be used if the JAR itself is sealed.
IPackageFragment
public boolean isDescriptionSaved()
The JAR writer defines the format of the file.
true
if this JAR package will be savedgetDescriptionLocation()
public void setSaveDescription(boolean state)
The format is defined by the client who implements the reader/writer pair.
state
- a boolean containing the new stategetDescriptionLocation()
,
IJarDescriptionWriter
public IPath getDescriptionLocation()
null
if none is specifiedpublic void setDescriptionLocation(IPath descriptionLocation)
descriptionLocation
- the path of locationpublic IFile getDescriptionFile()
public IType getManifestMainClass()
null
if none is specifiedpublic void setManifestMainClass(IType manifestMainClass)
public Object[] getElements()
IFile
and not containers.
public void setElements(Object[] elements)
IFile
.
and not containers.
elements
- an array with leaf objectspublic String getComment()
null
if the JAR does not contain a commentpublic void setComment(String comment)
comment
- a string or null
if the JAR does not contain a commentpublic boolean logErrors()
The export operation decides where and how the errors are logged.
true
if errors are loggedpublic void setLogErrors(boolean logErrors)
The export operation decides where and how the errors are logged.
logErrors
- true
if errors are loggedpublic boolean logWarnings()
The export operation decides where and how the warnings are logged.
true
if warnings are loggedpublic void setLogWarnings(boolean logWarnings)
The export operation decides where and how the warnings are logged.
logWarnings
- true
if warnings are loggedpublic boolean areErrorsExported()
true
if CUs with errors should be exportedpublic void setExportErrors(boolean exportErrors)
exportErrors
- true
if CUs with errors should be exportedpublic boolean exportWarnings()
true
if CUs with warnings should be exportedpublic void setExportWarnings(boolean exportWarnings)
exportWarnings
- true
if CUs with warnings should be exportedpublic boolean isBuildingIfNeeded()
public void setBuildIfNeeded(boolean fBuildIfNeeded)
public IFile[] findClassfilesFor(IFile javaFile) throws CoreException
This is a hook for subclasses which want to implement a different strategy for finding the class files. The default strategy is to query the class files for the source file name attribute. If this attribute is missing then all class files in the corresponding output folder are exported.
A CoreException can be thrown if an error occurs during this
operation. The CoreException
will not stop the export
process but adds the status object to the status of the
export runnable.
javaFile
- a .java file
null
to used the default strategy
CoreException
- if find failed, e.g. I/O error or resource out of synchIJarExportRunnable.getStatus()
public JarWriter createJarWriter(Shell parent) throws CoreException
parent
- the shell used to display question dialogs,
or null
if "false/no/cancel" is the answer
and no dialog should be shown
CoreException
JarWriter
public IJarExportRunnable createJarExportRunnable(Shell parent)
parent
- the parent for the dialog,
or null
if no questions should be asked and
no checks for unsaved files should be made.
public IJarExportRunnable createJarExportRunnable(JarPackageData[] jarPackagesData, Shell parent)
jarPackagesData
- an array with JAR package data objectsparent
- the parent for the dialog,
or null
if no dialog should be presentedpublic IJarDescriptionWriter createJarDescriptionWriter(OutputStream outputStream)
It is the client's responsibility to close this writer.
outputStream
- the output stream to write to
public IJarDescriptionReader createJarDescriptionReader(InputStream inputStream)
It is the client's responsibility to close this reader.
inputStream
- the input stream to read from
public boolean isValid()
true
if the JAR Package info is validpublic boolean isManifestAccessible()
true
if the manifest is generated or the provided one is accessiblepublic boolean isMainClassValid(IRunnableContext context)
true
if a main class is specified and valid
|
Eclipse JDT 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |