Class BndEditModel
java.lang.Object
aQute.bnd.build.model.BndEditModel
A model for a Bnd file.
The bndedit model maintains a Properties that can be modified/added with convenient semantic methods and/or properties can be deleted. The bnd file tends to be kept in a Processor, and the processors are kept in a inheritance chain. The BndEditModel can provide a Processor that extends the original but reflects the changes made in the inheritance model.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorBndEditModel(BndEditModel model) Copy constructorBndEditModel(BndEditModel model, boolean effective) Copy constructor with an override for effectiveBndEditModel(Project domain) BndEditModel(Workspace workspace) BndEditModel(Workspace workspace, Processor processor) BndEditModel(IDocument document) -
Method Summary
Modifier and TypeMethodDescription<T extends Collection<Object>>
StringvoidaddBundleBlueprint(String location) voidaddExportedPackage(ExportedPackage export) voidaddIncludeResource(String resource) voidaddPath(VersionedClause versionedClause, String header) voidvoidaddPrivatePackage(String packageName) voidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) static <T> StringUse 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) voidgenericSet(String propertyName, Object value) Return the saved changes in document format.Return the document propertiesgetEE()getGenericString(String name) longgetOwner()<T> Optional<T> Similar togetPlugins()but returns a map where the key is the property key of the bnd file e.g.Return a processor for this model.List<org.osgi.resource.Requirement> getRunFw()List<org.osgi.resource.Requirement> static StringbooleanisBndrun()booleanisCnf()Deprecated.booleanisDirty()booleanReturn if this model is handling effective properties (and this read only) or actual document properties.booleanisIncludedPackage(String packageName) booleanbooleanvoidload()voidvoidvoidloadFrom(InputStream inputStream) voidlookupConverter(String propertyName) lookupFormatter(String propertyName) voidvoidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) voidIf 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.voidsaveChangesTo(IDocument document) voidsetBndResource(File bndResource) voidsetBndResourceName(String bndResourceName) voidsetBuildPath(List<? extends VersionedClause> paths) voidsetBundleActivator(String bundleActivator) voidsetBundleBlueprint(List<HeaderClause> bundleBlueprint) voidsetBundleCategory(String bundleCategory) voidsetBundleContactAddress(String bundleContactAddress) voidsetBundleCopyright(String bundleCopyright) voidsetBundleDescription(String bundleDescription) voidsetBundleDocUrl(String bundleDocUrl) voidsetBundleLicense(String bundleLicense) voidsetBundleName(String bundleName) voidsetBundleSymbolicName(String bundleSymbolicName) voidsetBundleUpdateLocation(String bundleUpdateLocation) voidsetBundleVendor(String bundleVendor) voidsetBundleVersion(String bundleVersion) voidsetClassPath(List<? extends String> classPath) voidsetDirty(boolean isDirty) voidvoidsetDSAnnotationPatterns(List<? extends String> patterns) voidvoidsetExportedPackages(List<? extends ExportedPackage> exports) voidsetGenericString(String name, String value) voidsetIgnoreStandalone(List<HeaderClause> headers) voidsetImportPatterns(List<? extends ImportPattern> patterns) voidsetIncludeResource(List<String> newEntries) Deprecated.voidsetIncludeSources(boolean includeSources) voidsetOutputFile(String name) voidvoidsetPluginPath(List<String> pluginPath) voidsetPlugins(List<HeaderClause> plugins) voidsetPlugins(Map<String, List<BndEditModelHeaderClause>> plugins, Collection<String> pluginPropKeysToRemove) Updates and removes plugins (macros like (${.}) are not expanded).voidsetPrivatePackages(List<String> newPackages) voidsetProject(Project project) Deprecated.voidsetResolveMode(ResolutionInstructions.ResolveMode resolveMode) voidsetRunBlacklist(List<org.osgi.resource.Requirement> requires) voidsetRunBundles(List<? extends VersionedClause> paths) voidsetRunBundlesDecorator(List<? extends VersionedClause> paths) voidsetRunFramework(String clause) voidvoidsetRunProgramArgs(String args) voidsetRunProperties(Map<String, String> props) voidsetRunRepos(List<String> repos) voidsetRunRequires(List<org.osgi.resource.Requirement> requires) voidsetRunVMArgs(String args) voidsetServiceComponents(List<? extends ServiceComponent> components) voidsetStandaloneLinks(List<HeaderClause> headers) voidsetSubBndFiles(List<String> subBndFiles) voidsetSystemPackages(List<? extends ExportedPackage> packages) voidsetTestPath(List<? extends VersionedClause> paths) voidsetTestSuites(List<String> suites) voidsetWorkspace(Workspace workspace) static voidtoAsciiStream(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()Default constructor -
BndEditModel
-
BndEditModel
Copy constructor with an override for effective- Parameters:
model-effective-
-
BndEditModel
-
BndEditModel
- Throws:
IOException
-
BndEditModel
- Throws:
IOException
-
BndEditModel
- Throws:
IOException
-
-
Method Details
-
loadFrom
- Throws:
IOException
-
toEscaped
- Throws:
IOException
-
toAsciiStream
- Throws:
IOException
-
loadFrom
- 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
-
getRunBundlesDecorator
-
setRunBundlesDecorator
-
isIncludedPackage
-
getSubBndFiles
-
setSubBndFiles
-
getRunProperties
-
setRunProperties
-
getRunVMArgs
-
setRunVMArgs
-
getRunProgramArgs
-
setRunProgramArgs
-
getTestSuites
-
setTestSuites
-
getPlugins
-
setPlugins
-
getPluginsProperties
Similar togetPlugins()but returns a map where the key is the property key of the bnd file e.g.-plugin.1.Test, -plugin.2.MavenThe value is a List of plugins, although usually it is just a 1-element list. But it is also possible to specify multiple plugins under a single key, thus it is a list.- Returns:
- a map with a property keys and their plugins ( macros like (${.}) are returned not expanded)
-
setPlugins
public void setPlugins(Map<String, List<BndEditModelHeaderClause>> plugins, Collection<String> pluginPropKeysToRemove) Updates and removes plugins (macros like (${.}) are not expanded).- Parameters:
plugins-pluginPropKeysToRemove- the property keys to remove (not modified, caller needs to handle cleanup)
-
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
Deprecated. -
addIncludeResource
-
getProject
-
getWorkspace
-
setWorkspace
-
getGenericString
-
setGenericString
-
getProperties
Return a processor for this model. This processor is based on the properties of the source processor but with the values of the changed properties in this edit model. I.e. the view of the returned processor of the properties is the same as when this model would be saved.The returned processor will use the owner of this model as the parent so that all unchanged properties come from the original owner.
When using this method, realize that if you edit a project's bnd.bnd file, the returned processor adds an intermediate layer. The
owneris the original Workspace, Project, Bndrun, or sub bnd object.- Returns:
- a processor that reflects the actual processors setup
- Throws:
Exception
-
getDocumentChanges
-
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
Deprecated.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
-
getStem
-
add
-
getLastChangedAt
public long getLastChangedAt() -
setOwner
-
getOwner
-
getOwner
-
setProject
Deprecated. -
getDocumentProperties
Return the document properties -
isEffective
public boolean isEffective()Return if this model is handling effective properties (and this read only) or actual document properties.
-