Package aQute.bnd.build.model
Class BndEditModel
java.lang.Object
aQute.bnd.build.model.BndEditModel
A model for a Bnd file. In the first iteration, use a simple Properties
object; this will need to be enhanced to additionally record formatting, e.g.
line breaks and empty lines, and comments.
- Author:
- Neil Bartlett
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBndEditModel
(BndEditModel model) BndEditModel
(Project project) BndEditModel
(Workspace workspace) BndEditModel
(IDocument document) -
Method Summary
Modifier and TypeMethodDescription<T extends Collection<Object>>
Stringvoid
addBundleBlueprint
(String location) void
addExportedPackage
(ExportedPackage export) void
addIncludeResource
(String resource) void
addPath
(VersionedClause versionedClause, String header) void
void
addPrivatePackage
(String packageName) void
void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) static <T> String
Use the built in formatters to take an unformatted header and turn it into a formatted header useful in the editor, for example escaped newlines.genericGet
(String propertyName) void
genericSet
(String propertyName, Object value) Return the saved changes in document format.getEE()
getGenericString
(String name) Return a processor for this model.List<org.osgi.resource.Requirement>
getRunFw()
List<org.osgi.resource.Requirement>
boolean
isBndrun()
boolean
isCnf()
If this is on the cnf projectboolean
isDirty()
boolean
isIncludedPackage
(String packageName) boolean
boolean
void
load()
void
void
void
loadFrom
(InputStream inputStream) lookupConverter
(String propertyName) lookupFormatter
(String propertyName) void
void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
If this BndEditModel was created with a project then this method will save the changes in the document and will store them in the associated file.void
saveChangesTo
(IDocument document) void
setBndResource
(File bndResource) void
setBndResourceName
(String bndResourceName) void
setBuildPath
(List<? extends VersionedClause> paths) void
setBundleActivator
(String bundleActivator) void
setBundleBlueprint
(List<HeaderClause> bundleBlueprint) void
setBundleCategory
(String bundleCategory) void
setBundleContactAddress
(String bundleContactAddress) void
setBundleCopyright
(String bundleCopyright) void
setBundleDescription
(String bundleDescription) void
setBundleDocUrl
(String bundleDocUrl) void
setBundleLicense
(String bundleLicense) void
setBundleName
(String bundleName) void
setBundleSymbolicName
(String bundleSymbolicName) void
setBundleUpdateLocation
(String bundleUpdateLocation) void
setBundleVendor
(String bundleVendor) void
setBundleVersion
(String bundleVersion) void
setClassPath
(List<? extends String> classPath) void
setDirty
(boolean isDirty) void
void
setDSAnnotationPatterns
(List<? extends String> patterns) void
void
setExportedPackages
(List<? extends ExportedPackage> exports) void
setGenericString
(String name, String value) void
setIgnoreStandalone
(List<HeaderClause> headers) void
setImportPatterns
(List<? extends ImportPattern> patterns) void
setIncludeResource
(List<String> newEntries) void
setIncludeSources
(boolean includeSources) void
setOutputFile
(String name) void
setPluginPath
(List<String> pluginPath) void
setPlugins
(List<HeaderClause> plugins) void
setPrivatePackages
(List<String> newPackages) void
setProject
(Project project) void
setResolveMode
(ResolutionInstructions.ResolveMode resolveMode) void
setRunBlacklist
(List<org.osgi.resource.Requirement> requires) void
setRunBundles
(List<? extends VersionedClause> paths) void
setRunFramework
(String clause) void
void
setRunProgramArgs
(String args) void
setRunProperties
(Map<String, String> props) void
setRunRepos
(List<String> repos) void
setRunRequires
(List<org.osgi.resource.Requirement> requires) void
setRunVMArgs
(String args) void
setServiceComponents
(List<? extends ServiceComponent> components) void
setStandaloneLinks
(List<HeaderClause> headers) void
setSubBndFiles
(List<String> subBndFiles) void
setSystemPackages
(List<? extends ExportedPackage> packages) void
setTestPath
(List<? extends VersionedClause> paths) void
setTestSuites
(List<String> suites) void
setWorkspace
(Workspace workspace) static void
toAsciiStream
(IDocument doc)
-
Field Details
-
NEWLINE_LINE_SEPARATOR
- See Also:
-
LIST_SEPARATOR
- See Also:
-
PROP_WORKSPACE
- See Also:
-
BUNDLE_VERSION_MACRO
- See Also:
-
-
Constructor Details
-
BndEditModel
public BndEditModel() -
BndEditModel
-
BndEditModel
-
BndEditModel
- Throws:
IOException
-
BndEditModel
- Throws:
IOException
-
-
Method Details
-
loadFrom
- Throws:
IOException
-
toEscaped
- Throws:
IOException
-
toAsciiStream
- Throws:
IOException
-
loadFrom
- Throws:
IOException
-
loadFrom
- Throws:
IOException
-
saveChangesTo
-
getAllPropertyNames
-
lookupConverter
-
lookupFormatter
-
genericGet
-
genericSet
-
getBundleLicense
-
setBundleLicense
-
getBundleCategory
-
setBundleCategory
-
getBundleName
-
setBundleName
-
getBundleDescription
-
setBundleDescription
-
getBundleCopyright
-
setBundleCopyright
-
getBundleUpdateLocation
-
setBundleUpdateLocation
-
getBundleVendor
-
setBundleVendor
-
getBundleContactAddress
-
setBundleContactAddress
-
getBundleDocUrl
-
setBundleDocUrl
-
getBundleSymbolicName
-
setBundleSymbolicName
-
getBundleVersionString
-
setBundleVersion
-
getBundleActivator
-
setBundleActivator
-
getOutputFile
-
setOutputFile
-
isIncludeSources
public boolean isIncludeSources() -
setIncludeSources
public void setIncludeSources(boolean includeSources) -
getPrivatePackages
-
setPrivatePackages
-
addPrivatePackage
-
getSystemPackages
-
setSystemPackages
-
getClassPath
-
setClassPath
-
getExportedPackages
-
setExportedPackages
-
addExportedPackage
-
getDSAnnotationPatterns
-
setDSAnnotationPatterns
-
getServiceComponents
-
setServiceComponents
-
getImportPatterns
-
setImportPatterns
-
getBuildPath
-
getTestPath
-
setBuildPath
-
addPath
-
addPath
-
setTestPath
-
getRunBundles
-
setRunBundles
-
isIncludedPackage
-
getSubBndFiles
-
setSubBndFiles
-
getRunProperties
-
setRunProperties
-
getRunVMArgs
-
setRunVMArgs
-
getRunProgramArgs
-
setRunProgramArgs
-
getTestSuites
-
setTestSuites
-
getPlugins
-
setPlugins
-
getPluginPath
-
setPluginPath
-
getDistro
-
setDistro
-
getRunRepos
-
setRunRepos
-
getRunFramework
-
getRunFw
-
getEE
-
setEE
-
setRunFramework
-
setRunFw
-
getRunRequires
-
setRunRequires
-
getRunBlacklist
-
setRunBlacklist
-
getStandaloneLinks
-
setStandaloneLinks
-
getIgnoreStandalone
-
setIgnoreStandalone
-
isProjectFile
public boolean isProjectFile() -
isBndrun
public boolean isBndrun() -
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
removePropertyChangeListener
-
setBndResource
-
getBndResource
-
getBndResourceName
-
setBndResourceName
-
getBundleBlueprint
-
setBundleBlueprint
-
addBundleBlueprint
-
getIncludeResource
-
setIncludeResource
-
addIncludeResource
-
setProject
-
getProject
-
getWorkspace
-
setWorkspace
-
getGenericString
-
setGenericString
-
getProperties
Return a processor for this model. This processor is based on the parent project or the bndrun file. It will contain the properties of the project file and the changes from the model.- Returns:
- a processor that reflects the actual project or bndrun file setup
- Throws:
Exception
-
getDocumentChanges
Return the saved changes in document format. -
saveChanges
If this BndEditModel was created with a project then this method will save the changes in the document and will store them in the associated file.- Throws:
IOException
-
store
- Throws:
IOException
-
getResolveMode
-
setResolveMode
-
isDirty
public boolean isDirty()- Returns:
- true if there is a discrepancy between the project's file and the document
-
setDirty
public void setDirty(boolean isDirty) -
load
- Throws:
IOException
-
isCnf
public boolean isCnf()If this is on the cnf project- Returns:
- true if it is the cnf project
-
format
Use the built in formatters to take an unformatted header and turn it into a formatted header useful in the editor, for example escaped newlines.- Type Parameters:
T
- the intermediate type, doesn't matter- Parameters:
header
- the name of the instructioninput
- the source string- Returns:
- the input or a formatted input if there is converter
-
add
-