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 Fileprivate Stringprivate static final Converter<List<VersionedClause>,String> static final Stringprivate static final Converter<List<VersionedClause>,String> private static final Converter<String,Collection<? extends HeaderClause>> private booleanprivate IDocumentprivate 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 Stringstatic final Stringprivate Projectstatic final Stringprivate final PropertyChangeSupportprivate Propertiesprivate 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>>
StringvoidaddBundleBlueprint(String location) voidaddExportedPackage(ExportedPackage export) voidaddIncludeResource(String resource) voidaddPath(VersionedClause versionedClause, String header) voidvoidaddPrivatePackage(String packageName) voidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) private Stringprivate static <E> List<E>disjunction(Collection<E> collection, Collection<?> remove) private <R> RdoGetObject(String name, Converter<? extends R, ? super String> converter) private <T> voiddoRemoveObject(String name, T oldValue, T newValue, Converter<String, ? super T> formatter) private <T> voiddoSetObject(String name, T oldValue, T newValue, Converter<String, ? super T> formatter) private static IRegionstatic <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.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 booleanprivate booleanbooleanisBndrun()booleanisCnf()If this is on the cnf projectbooleanisDirty()booleanisIncludedPackage(String packageName) booleanbooleanvoidload()voidvoidvoidloadFrom(InputStream inputStream) lookupConverter(String propertyName) lookupFormatter(String propertyName) private voidremoveEntries(String key) 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) voidprivate voidsetEntries(List<? extends String> packages, String key) voidsetExportedPackages(List<? extends ExportedPackage> exports) voidsetGenericString(String name, String value) voidsetIgnoreStandalone(List<HeaderClause> headers) voidsetImportPatterns(List<? extends ImportPattern> patterns) voidsetIncludeResource(List<String> newEntries) voidsetIncludeSources(boolean includeSources) voidsetOutputFile(String name) voidsetPluginPath(List<String> pluginPath) voidsetPlugins(List<HeaderClause> plugins) voidsetPrivatePackages(List<String> newPackages) voidsetProject(Project project) voidsetResolveMode(ResolutionInstructions.ResolveMode resolveMode) voidsetRunBlacklist(List<org.osgi.resource.Requirement> requires) voidsetRunBundles(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) private static voidupdateDocument(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
-