org.eclipse.cdt.managedbuilder.internal.core
Class OutputType

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.internal.core.BuildObject
      extended by org.eclipse.cdt.managedbuilder.internal.core.OutputType
All Implemented Interfaces:
IBuildObject, IOutputType

public class OutputType
extends BuildObject
implements IOutputType


Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IOutputType
BUILD_VARIABLE, MULTIPLE_OF_TYPE, NAME_PATTERN, NAME_PROVIDER, OPTION, OUTPUT_CONTENT_TYPE, OUTPUT_NAMES, OUTPUT_PREFIX, OUTPUT_TYPE_ELEMENT_NAME, OUTPUTS, PRIMARY_INPUT_TYPE, PRIMARY_OUTPUT
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IBuildObject
ID, NAME
 
Constructor Summary
OutputType(ITool parent, org.eclipse.cdt.core.settings.model.ICStorageElement element)
          Create an OutputType based on the specification stored in the project file (.cdtbuild).
OutputType(ITool parent, IManagedConfigElement element)
          This constructor is called to create an OutputType defined by an extension point in a plugin manifest file, or returned by a dynamic element provider
OutputType(ITool parent, java.lang.String Id, java.lang.String name, OutputType outputType)
          Create an OutputType based upon an existing OutputType.
OutputType(Tool parent, IOutputType superClass, java.lang.String Id, java.lang.String name, boolean isExtensionElement)
          This constructor is called to create an OutputType whose attributes will be set by separate calls.
 
Method Summary
 BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator()
           
 java.lang.String getBuildVariable()
          Returns the name of the build variable associated this this output type's resources The variable is used in the build file to represent the list of output files.
 java.lang.String getManagedBuildRevision()
           
 boolean getMultipleOfType()
          Returns true if this outputType creates multiple output resources in one invocation of the tool, else false.
 java.lang.String getName()
           
 java.lang.String getNamePattern()
          Returns the pattern, using the Gnu pattern rule syntax, for deriving the output resource name from the input resource name.
 IManagedOutputNameProvider getNameProvider()
          Returns the IManagedOutputNameProvider interface as specified by the nameProvider attribute.
 org.eclipse.core.runtime.IConfigurationElement getNameProviderElement()
           
 java.lang.String getOptionId()
          Returns the id of the option that is associated with this output type on the command line.
 org.eclipse.core.runtime.content.IContentType getOutputContentType()
          Returns the Eclipse IContentType that describes this output type.
 java.lang.String[] getOutputExtensions(ITool tool)
          Returns the list of the output extensions that the receiver can build.
 java.lang.String[] getOutputExtensions(ITool tool, org.eclipse.core.resources.IProject project)
           
 java.lang.String[] getOutputExtensionsAttribute()
          Returns the list of valid output extensions from the outputs attribute.
 java.lang.String[] getOutputNames()
          Returns the file names of the complete set of output files for this outputType
 java.lang.String getOutputPrefix()
          Returns the prefix that the tool should prepend to the name of the build artifact.
 ITool getParent()
          Returns the tool defining this OutputType.
 IInputType getPrimaryInputType()
          Returns the input type that is used in determining the default names of this output type.
 boolean getPrimaryOutput()
          Returns true if this is considered the primary output of the tool, else false.
 IOutputType getSuperClass()
          Returns the IOutputType that is the superclass of this OutputType, or null if the attribute was not specified.
 org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
           
 boolean hasCustomSettings()
           
 boolean isDirty()
          Returns true if this element has changes that need to be saved in the project file, else false.
 boolean isEnabled(ITool tool)
           
 boolean isExtensionElement()
          Returns true if this OutputType was loaded from a manifest file, and false if it was loaded from a project (.cdtbuild) file.
 boolean isOutputExtension(ITool tool, java.lang.String ext)
          Answers true if the output type considers the file extension to be one associated with an output file.
 boolean needsRebuild()
           
 void resolveReferences()
           
 void serialize(org.eclipse.cdt.core.settings.model.ICStorageElement element)
          Persist the OutputType to the project file.
 void setBuildVariable(java.lang.String variableName)
          Sets the name of the build variable associated this this output type's resources.
 void setDirty(boolean isDirty)
          Sets the element's "dirty" (have I been modified?)
 void setMultipleOfType(boolean b)
          Sets whether this outputType can create multiple output resources in one invocation of the tool.
 void setNamePattern(java.lang.String pattern)
          Sets the pattern, using the Gnu pattern rule syntax, for deriving the output resource name from the input resource name.
 void setNameProviderElement(org.eclipse.core.runtime.IConfigurationElement element)
           
 void setOptionId(java.lang.String id)
          Sets the id of the option that is associated with this output type on the command line.
 void setOutputContentType(org.eclipse.core.runtime.content.IContentType type)
          Sets the Eclipse IContentType that describes this output type.
 void setOutputExtensionsAttribute(java.lang.String exts)
          Sets all of the output extensions that the receiver can build.
 void setOutputNames(java.lang.String names)
          Sets the complete set of output file names for this outputType
 void setOutputPrefix(java.lang.String prefix)
          Sets the prefix that the tool should prepend to the name of the build artifact.
 void setPrimaryInputType(IInputType type)
          Sets the input type that is used in determining the default names of this output type.
 void setPrimaryOutput(boolean b)
          Sets whether this is the primary output of the tool.
 void setRebuildState(boolean rebuild)
           
 void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
           
 
Methods inherited from class org.eclipse.cdt.managedbuilder.internal.core.BuildObject
getBaseId, getId, getVersionFromId, setId, setManagedBuildRevision, setName, toString, updateManagedBuildRevision
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.cdt.managedbuilder.core.IBuildObject
getBaseId, getId
 

Constructor Detail

OutputType

public OutputType(ITool parent,
                  IManagedConfigElement element)
This constructor is called to create an OutputType defined by an extension point in a plugin manifest file, or returned by a dynamic element provider

Parameters:
parent - The ITool parent of this OutputType
element - The OutputType definition from the manifest file or a dynamic element provider

OutputType

public OutputType(Tool parent,
                  IOutputType superClass,
                  java.lang.String Id,
                  java.lang.String name,
                  boolean isExtensionElement)
This constructor is called to create an OutputType whose attributes will be set by separate calls.

Parameters:
Tool - The parent of the an OutputType
OutputType - The superClass, if any
String - The id for the new OutputType
String - The name for the new OutputType
boolean - Indicates whether this is an extension element or a managed project element

OutputType

public OutputType(ITool parent,
                  org.eclipse.cdt.core.settings.model.ICStorageElement element)
Create an OutputType based on the specification stored in the project file (.cdtbuild).

Parameters:
parent - The ITool the OutputType will be added to.
element - The XML element that contains the OutputType settings.

OutputType

public OutputType(ITool parent,
                  java.lang.String Id,
                  java.lang.String name,
                  OutputType outputType)
Create an OutputType based upon an existing OutputType.

Parameters:
parent - The ITool the OutputType will be added to.
Id - The identifier of the new OutputType
name - The name of the new OutputType
outputType - The existing OutputType to clone.
Method Detail

serialize

public void serialize(org.eclipse.cdt.core.settings.model.ICStorageElement element)
Persist the OutputType to the project file.

Parameters:
doc -
element -

getParent

public ITool getParent()
Description copied from interface: IOutputType
Returns the tool defining this OutputType.

Specified by:
getParent in interface IOutputType
Returns:
ITool

getSuperClass

public IOutputType getSuperClass()
Description copied from interface: IOutputType
Returns the IOutputType that is the superclass of this OutputType, or null if the attribute was not specified.

Specified by:
getSuperClass in interface IOutputType
Returns:
IInputType

getName

public java.lang.String getName()
Specified by:
getName in interface IBuildObject
Overrides:
getName in class BuildObject

getBuildVariable

public java.lang.String getBuildVariable()
Description copied from interface: IOutputType
Returns the name of the build variable associated this this output type's resources The variable is used in the build file to represent the list of output files. The same variable name can be used by an inputType to identify a set of output files that contribute to the tool's input (i.e., those using the same buildVariable name). The default name is chosen by MBS.

Specified by:
getBuildVariable in interface IOutputType
Returns:
String

setBuildVariable

public void setBuildVariable(java.lang.String variableName)
Description copied from interface: IOutputType
Sets the name of the build variable associated this this output type's resources.

Specified by:
setBuildVariable in interface IOutputType

getMultipleOfType

public boolean getMultipleOfType()
Description copied from interface: IOutputType
Returns true if this outputType creates multiple output resources in one invocation of the tool, else false.

Specified by:
getMultipleOfType in interface IOutputType
Returns:
boolean

setMultipleOfType

public void setMultipleOfType(boolean b)
Description copied from interface: IOutputType
Sets whether this outputType can create multiple output resources in one invocation of the tool.

Specified by:
setMultipleOfType in interface IOutputType

getNamePattern

public java.lang.String getNamePattern()
Description copied from interface: IOutputType
Returns the pattern, using the Gnu pattern rule syntax, for deriving the output resource name from the input resource name. The default is to use the input file base filename with the output extension.

Specified by:
getNamePattern in interface IOutputType
Returns:
String

setNamePattern

public void setNamePattern(java.lang.String pattern)
Description copied from interface: IOutputType
Sets the pattern, using the Gnu pattern rule syntax, for deriving the output resource name from the input resource name.

Specified by:
setNamePattern in interface IOutputType

getNameProviderElement

public org.eclipse.core.runtime.IConfigurationElement getNameProviderElement()

setNameProviderElement

public void setNameProviderElement(org.eclipse.core.runtime.IConfigurationElement element)

getNameProvider

public IManagedOutputNameProvider getNameProvider()
Description copied from interface: IOutputType
Returns the IManagedOutputNameProvider interface as specified by the nameProvider attribute.

Specified by:
getNameProvider in interface IOutputType
Returns:
IManagedOutputNameProvider

getOptionId

public java.lang.String getOptionId()
Description copied from interface: IOutputType
Returns the id of the option that is associated with this output type on the command line. The default is to use the Tool "outputFlag" attribute if primaryOutput is True. If option is not specified, and primaryOutput is False, then the output file(s) of this outputType are not added to the command line. When specified, the namePattern, nameProvider and outputNames are ignored.

Specified by:
getOptionId in interface IOutputType
Returns:
String

setOptionId

public void setOptionId(java.lang.String id)
Description copied from interface: IOutputType
Sets the id of the option that is associated with this output type on the command line.

Specified by:
setOptionId in interface IOutputType

getOutputContentType

public org.eclipse.core.runtime.content.IContentType getOutputContentType()
Description copied from interface: IOutputType
Returns the Eclipse IContentType that describes this output type. If both the outputs attribute and the outputContentType attribute are specified, the outputContentType will be used if it is defined in Eclipse.

Specified by:
getOutputContentType in interface IOutputType
Returns:
IContentType

setOutputContentType

public void setOutputContentType(org.eclipse.core.runtime.content.IContentType type)
Description copied from interface: IOutputType
Sets the Eclipse IContentType that describes this output type.

Specified by:
setOutputContentType in interface IOutputType
Parameters:
type - The Eclipse content type

getOutputExtensionsAttribute

public java.lang.String[] getOutputExtensionsAttribute()
Description copied from interface: IOutputType
Returns the list of valid output extensions from the outputs attribute. Note that this value is not used if output content type is specified and registered with Eclipse. Also, the user will not be able to modify the set of file extensions as they can when outputContentType is specified.

Specified by:
getOutputExtensionsAttribute in interface IOutputType
Returns:
String[] of extensions

setOutputExtensionsAttribute

public void setOutputExtensionsAttribute(java.lang.String exts)
Description copied from interface: IOutputType
Sets all of the output extensions that the receiver can build. NOTE: The value of this attribute will NOT be used if a output content type is specified and is registered with Eclipse.

Specified by:
setOutputExtensionsAttribute in interface IOutputType

getOutputExtensions

public java.lang.String[] getOutputExtensions(ITool tool,
                                              org.eclipse.core.resources.IProject project)

getOutputExtensions

public java.lang.String[] getOutputExtensions(ITool tool)
Description copied from interface: IOutputType
Returns the list of the output extensions that the receiver can build. Note that the list will come from the outputContentType if it is specified and registered with Eclipse. Otherwise the outputs attribute will be used.

Specified by:
getOutputExtensions in interface IOutputType
Parameters:
tool - the tool that contains the output-type
Returns:
String[]

isOutputExtension

public boolean isOutputExtension(ITool tool,
                                 java.lang.String ext)
Description copied from interface: IOutputType
Answers true if the output type considers the file extension to be one associated with an output file.

Specified by:
isOutputExtension in interface IOutputType
Parameters:
tool - the tool that contains the output-type
ext - file extension
Returns:
boolean

getOutputPrefix

public java.lang.String getOutputPrefix()
Description copied from interface: IOutputType
Returns the prefix that the tool should prepend to the name of the build artifact. For example, a librarian usually prepends 'lib' to the target.a

Specified by:
getOutputPrefix in interface IOutputType
Returns:
String

setOutputPrefix

public void setOutputPrefix(java.lang.String prefix)
Description copied from interface: IOutputType
Sets the prefix that the tool should prepend to the name of the build artifact. For example, a librarian usually prepends 'lib' to the target.a

Specified by:
setOutputPrefix in interface IOutputType

getOutputNames

public java.lang.String[] getOutputNames()
Description copied from interface: IOutputType
Returns the file names of the complete set of output files for this outputType

Specified by:
getOutputNames in interface IOutputType
Returns:
String[]

setOutputNames

public void setOutputNames(java.lang.String names)
Description copied from interface: IOutputType
Sets the complete set of output file names for this outputType

Specified by:
setOutputNames in interface IOutputType

getPrimaryInputType

public IInputType getPrimaryInputType()
Description copied from interface: IOutputType
Returns the input type that is used in determining the default names of this output type.

Specified by:
getPrimaryInputType in interface IOutputType
Returns:
IInputType

setPrimaryInputType

public void setPrimaryInputType(IInputType type)
Description copied from interface: IOutputType
Sets the input type that is used in determining the default names of this output type.

Specified by:
setPrimaryInputType in interface IOutputType

getPrimaryOutput

public boolean getPrimaryOutput()
Description copied from interface: IOutputType
Returns true if this is considered the primary output of the tool, else false.

Specified by:
getPrimaryOutput in interface IOutputType
Returns:
boolean

setPrimaryOutput

public void setPrimaryOutput(boolean b)
Description copied from interface: IOutputType
Sets whether this is the primary output of the tool.

Specified by:
setPrimaryOutput in interface IOutputType

isExtensionElement

public boolean isExtensionElement()
Description copied from interface: IOutputType
Returns true if this OutputType was loaded from a manifest file, and false if it was loaded from a project (.cdtbuild) file.

Specified by:
isExtensionElement in interface IOutputType
Returns:
boolean

isDirty

public boolean isDirty()
Description copied from interface: IOutputType
Returns true if this element has changes that need to be saved in the project file, else false.

Specified by:
isDirty in interface IOutputType
Returns:
boolean

setDirty

public void setDirty(boolean isDirty)
Description copied from interface: IOutputType
Sets the element's "dirty" (have I been modified?) flag.

Specified by:
setDirty in interface IOutputType

resolveReferences

public void resolveReferences()

getManagedBuildRevision

public java.lang.String getManagedBuildRevision()
Specified by:
getManagedBuildRevision in interface IBuildObject
Overrides:
getManagedBuildRevision in class BuildObject
Returns:
Returns the managedBuildRevision.

getVersion

public org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
Specified by:
getVersion in interface IBuildObject
Overrides:
getVersion in class BuildObject
Returns:
Returns the version.

setVersion

public void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
Specified by:
setVersion in interface IBuildObject
Overrides:
setVersion in class BuildObject
Parameters:
version - The version to set.

needsRebuild

public boolean needsRebuild()

setRebuildState

public void setRebuildState(boolean rebuild)

getBooleanExpressionCalculator

public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator()

isEnabled

public boolean isEnabled(ITool tool)

hasCustomSettings

public boolean hasCustomSettings()