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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate File
private String
private static final Converter<List<VersionedClause>,
String> static final String
private static final Converter<List<VersionedClause>,
String> private static final Converter<String,
Collection<? extends HeaderClause>> private boolean
private IDocument
private static final Converter<List<ExportedPackage>,
String> private static final Converter<List<HeaderClause>,
String> private static final Converter<String,
Collection<? extends HeaderClause>> private static final Converter<List<ImportPattern>,
String> private static String[]
static final String
static final String
private Project
static final String
private final PropertyChangeSupport
private Properties
private static final Converter<String,
Collection<? extends org.osgi.resource.Requirement>> private static final Converter<String,
Collection<? extends String>> private static final Converter<List<ServiceComponent>,
String> private static final Converter<String,
Collection<? extends HeaderClause>> private static final Converter<String,
Collection<?>> private Workspace
-
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) private String
private static <E> List<E>
disjunction
(Collection<E> collection, Collection<?> remove) private <R> R
doGetObject
(String name, Converter<? extends R, ? super String> converter) private <T> void
doRemoveObject
(String name, T oldValue, T newValue, Converter<String, ? super T> formatter) private <T> void
doSetObject
(String name, T oldValue, T newValue, Converter<String, ? super T> formatter) private static IRegion
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()
getEntries
(String instruction, Converter<? extends E, ? super String> converter) getGenericString
(String name) Return a processor for this model.List<org.osgi.resource.Requirement>
getRunFw()
List<org.osgi.resource.Requirement>
private boolean
private boolean
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) private void
removeEntries
(String key) 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
private void
setEntries
(List<? extends String> packages, String key) 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) private static void
updateDocument
(IDocument document, String name, String value)
-
Field Details
-
NEWLINE_LINE_SEPARATOR
- See Also:
-
LIST_SEPARATOR
- See Also:
-
KNOWN_PROPERTIES
-
PROP_WORKSPACE
- See Also:
-
BUNDLE_VERSION_MACRO
- See Also:
-
converters
-
formatters
-
bndResource
-
bndResourceName
-
propChangeSupport
-
properties
-
objectProperties
-
changesToSave
-
project
-
dirty
private volatile boolean dirty -
buildPathConverter
-
clauseListConverter
-
stringConverter
-
includedSourcesConverter
-
listConverter
-
exportPackageConverter
-
serviceComponentConverter
-
importPatternConverter
-
propertiesConverter
-
requirementListConverter
-
eeConverter
-
newlineEscapeFormatter
-
defaultFalseBoolFormatter
-
stringListFormatter
-
headerClauseListConverter
-
headerClauseListFormatter
-
complexHeaderClauseListFormatter
private static final Converter<String,Collection<? extends HeaderClause>> complexHeaderClauseListFormatter -
propertiesFormatter
-
requirementListFormatter
private static final Converter<String,Collection<? extends org.osgi.resource.Requirement>> requirementListFormatter -
standaloneLinkListFormatter
private static final Converter<String,Collection<? extends HeaderClause>> standaloneLinkListFormatter -
eeFormatter
-
runReposFormatter
-
workspace
-
document
-
-
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
-
findEntry
- Throws:
Exception
-
updateDocument
-
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
-
setEntries
-
removeEntries
-
addPrivatePackage
-
hasPrivatePackageInstruction
private boolean hasPrivatePackageInstruction() -
getEntries
-
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
-
doGetObject
-
doRemoveObject
-
doSetObject
-
isProjectFile
public boolean isProjectFile() -
isBndrun
public boolean isBndrun() -
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
removePropertyChangeListener
-
setBndResource
-
getBndResource
-
getBndResourceName
-
setBndResourceName
-
getBundleBlueprint
-
setBundleBlueprint
-
addBundleBlueprint
-
getIncludeResource
-
setIncludeResource
-
addIncludeResource
-
hasIncludeResourceInstruction
private boolean hasIncludeResourceInstruction() -
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
-
cleanup
-
disjunction
-
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
-