Class MutableManifestElement
- java.lang.Object
-
- org.eclipse.tycho.versions.bundle.MutableManifestElement
-
public class MutableManifestElement extends java.lang.Object
This class is similar toManifestElement
but supports changing value for attributes with a single value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MutableManifestElement.ParameterType
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>>
attributes
private static int
DEFAULT_WRAP_FOR_LONG_DIRECTIVES
private static java.lang.String
DIRECTIVE_INDENT
private java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>>
directives
private static int
NO_WRAP
private static java.util.regex.Pattern
OSGI_EXTENDED_PATTERN
See extended definition in osgi core spec at paragraph 1.3.2 General Syntax Definitionsprivate java.lang.String
value
private static java.lang.String
VALUE_COMPONENT_INDENT
private static java.lang.String
XFRIENDS_DIRECTIVE
-
Constructor Summary
Constructors Modifier Constructor Description MutableManifestElement(java.lang.String value, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.Map<java.lang.String,java.lang.String> directives)
private
MutableManifestElement(org.eclipse.osgi.util.ManifestElement manifestElement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAttribute(java.lang.String key)
Returns the value for the specified attribute ornull
if it does not exist.java.lang.String
getValue()
private static boolean
paramValueNeedsQuotes(java.lang.String value)
static java.util.List<MutableManifestElement>
parseHeader(java.lang.String name, java.lang.String value)
boolean
setAttribute(java.lang.String key, java.lang.String value)
Set the value for the specified attribute.private java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>>
toMapOfSingletonLists(java.util.Map<java.lang.String,java.lang.String> params)
java.lang.String
toString()
java.lang.String
write()
private static java.lang.String
writeParameter(java.lang.String paramName, java.lang.String parameterValue, MutableManifestElement.ParameterType paramType, int valueComponentLimit)
-
-
-
Field Detail
-
OSGI_EXTENDED_PATTERN
private static final java.util.regex.Pattern OSGI_EXTENDED_PATTERN
See extended definition in osgi core spec at paragraph 1.3.2 General Syntax Definitions
-
DIRECTIVE_INDENT
private static final java.lang.String DIRECTIVE_INDENT
- See Also:
- Constant Field Values
-
VALUE_COMPONENT_INDENT
private static final java.lang.String VALUE_COMPONENT_INDENT
- See Also:
- Constant Field Values
-
NO_WRAP
private static final int NO_WRAP
- See Also:
- Constant Field Values
-
XFRIENDS_DIRECTIVE
private static final java.lang.String XFRIENDS_DIRECTIVE
- See Also:
- Constant Field Values
-
DEFAULT_WRAP_FOR_LONG_DIRECTIVES
private static final int DEFAULT_WRAP_FOR_LONG_DIRECTIVES
- See Also:
- Constant Field Values
-
value
private final java.lang.String value
-
directives
private final java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> directives
-
attributes
private final java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> attributes
-
-
Constructor Detail
-
MutableManifestElement
public MutableManifestElement(java.lang.String value, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.Map<java.lang.String,java.lang.String> directives)
-
MutableManifestElement
private MutableManifestElement(org.eclipse.osgi.util.ManifestElement manifestElement)
-
-
Method Detail
-
toMapOfSingletonLists
private java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> toMapOfSingletonLists(java.util.Map<java.lang.String,java.lang.String> params)
-
parseHeader
public static java.util.List<MutableManifestElement> parseHeader(java.lang.String name, java.lang.String value) throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
getValue
public java.lang.String getValue()
- Returns:
- See Also:
ManifestElement.getValue()
-
setAttribute
public boolean setAttribute(java.lang.String key, java.lang.String value)
Set the value for the specified attribute. If previous values existed they are replaced.- Parameters:
key
-value
-- Returns:
- returns true if the manifest element changed due to this call. false if the value was already the same.
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
Returns the value for the specified attribute ornull
if it does not exist. If the attribute has multiple values specified then the last value specified is returned.- Parameters:
key
-- Returns:
- See Also:
ManifestElement.getAttribute(String)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
write
public java.lang.String write()
-
writeParameter
private static java.lang.String writeParameter(java.lang.String paramName, java.lang.String parameterValue, MutableManifestElement.ParameterType paramType, int valueComponentLimit)
-
paramValueNeedsQuotes
private static boolean paramValueNeedsQuotes(java.lang.String value)
-
-