Class MutableManifestElement
- java.lang.Object
-
- org.eclipse.tycho.versions.bundle.MutableManifestElement
-
public class MutableManifestElement extends java.lang.ObjectThis class is similar toManifestElementbut supports changing value for attributes with a single value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classMutableManifestElement.ParameterType
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>>attributesprivate static intDEFAULT_WRAP_FOR_LONG_DIRECTIVESprivate static java.lang.StringDIRECTIVE_INDENTprivate java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>>directivesprivate static intNO_WRAPprivate static java.util.regex.PatternOSGI_EXTENDED_PATTERNSee extended definition in osgi core spec at paragraph 1.3.2 General Syntax Definitionsprivate java.lang.Stringvalueprivate static java.lang.StringVALUE_COMPONENT_INDENTprivate static java.lang.StringXFRIENDS_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)privateMutableManifestElement(org.eclipse.osgi.util.ManifestElement manifestElement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAttribute(java.lang.String key)Returns the value for the specified attribute ornullif it does not exist.java.lang.StringgetValue()private static booleanparamValueNeedsQuotes(java.lang.String value)static java.util.List<MutableManifestElement>parseHeader(java.lang.String name, java.lang.String value)booleansetAttribute(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.StringtoString()java.lang.Stringwrite()private static java.lang.StringwriteParameter(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 ornullif 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:
toStringin 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)
-
-