Package org.apache.aries.util.manifest
Class ManifestHeaderProcessor
java.lang.Object
org.apache.aries.util.manifest.ManifestHeaderProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA GenericMetadata is either a Generic Capability or a Generic Requirementstatic interfaceIntended to provide a standard way to add Name/Value's to aggregations of Name/Value's.static classList of Name/Valuestatic classMap of Name -> Value.static classA simple class to associate two types. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringGenerate a filter from a set of attributes.static StringgenerateFilter(Map<String, String> attribs) Generate a filter from a set of attributes.Parse a bundle symbolic name.Parse a generic capability header.parseExportList(List<String> list) Parse an export style header in a list.Parse an export style header.parseFilter(String filter) Parse an import style header.Parse a generic capability header.static VersionRangeParse a version range..static VersionRangeparseVersionRange(String s, boolean exactVersion) Parse a version range and indicate if the version is an exact versionSplits a delimiter separated string, tolerating presence of non separator commas within double quoted segments.
-
Field Details
-
NESTED_FILTER_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
ManifestHeaderProcessor
public ManifestHeaderProcessor()
-
-
Method Details
-
split
Splits a delimiter separated string, tolerating presence of non separator commas within double quoted segments. Eg. com.ibm.ws.eba.helloWorldService;version="[1.0.0, 1.0.0]" invalid input: '&' com.ibm.ws.eba.helloWorldService;version="1.0.0" com.ibm.ws.eba.helloWorld;version="2";bundle-version="[2,30)" com.acme.foo;weirdAttr="one;two;three";weirdDir:="1;2;3"- Parameters:
value- the value to be splitdelimiter- the delimiter string such as ',' etc.- Returns:
- List
the components of the split String in a list
-
parseExportString
Parse an export style header.pkg1;attrib=value;attrib=value,pkg2;attrib=value,pkg3;attrib=value2
Result is returned as a list, as export does allow duplicate package exports.
- Parameters:
s- The data to parse.- Returns:
- List of NameValuePairs, where each Name in the list is an exported package, with its associated Value being a NameValueMap of any attributes declared.
-
parseExportList
Parse an export style header in a list.pkg1;attrib=value;attrib=value pkg2;attrib=value pkg3;attrib=value2
Result is returned as a list, as export does allow duplicate package exports.
- Parameters:
list- The data to parse.- Returns:
- List of NameValuePairs, where each Name in the list is an exported package, with its associated Value being a NameValueMap of any attributes declared.
-
parseImportString
Parse an import style header.pkg1;attrib=value;attrib=value,pkg2;attrib=value,pkg3;attrib=value
Result is returned as a set, as import does not allow duplicate package imports.
- Parameters:
s- The data to parse.- Returns:
- Map of NameValuePairs, where each Key in the Map is an imported package, with its associated Value being a NameValueMap of any attributes declared.
-
parseCapabilityString
Parse a generic capability header. For example
com.acme.myns;mylist:List="nl,be,fr,uk";myver:Version=1.3;long:Long="1234";d:Double="3.14";myattr=xyz, com.acme.myns;myattr=abc - Parameters:
s- The header to be parsed- Returns:
- A list of GenericMetadata objects each representing an individual capability. The values in the attribute map are of the specified datatype.
-
parseRequirementString
Parse a generic capability header. For example
com.acme.myns;mylist:List="nl,be,fr,uk";myver:Version=1.3;long:Long="1234";d:Double="3.14";myattr=xyz, com.acme.myns;myattr=abc - Parameters:
s- The header to be parsed- Returns:
- A list of GenericMetadata objects each representing an individual capability. The values in the attribute map are of the specified datatype.
-
parseBundleSymbolicName
Parse a bundle symbolic name.bundlesymbolicname;attrib=value;attrib=value
- Parameters:
s- The data to parse.- Returns:
- NameValuePair with Name being the BundleSymbolicName, and Value being any attribs declared for the name.
-
parseVersionRange
Parse a version range..- Parameters:
s-- Returns:
- VersionRange object.
- Throws:
IllegalArgumentException- if the String could not be parsed as a VersionRange
-
parseVersionRange
public static VersionRange parseVersionRange(String s, boolean exactVersion) throws IllegalArgumentException Parse a version range and indicate if the version is an exact version- Parameters:
s-exactVersion-- Returns:
- VersionRange object.
- Throws:
IllegalArgumentException- if the String could not be parsed as a VersionRange
-
generateFilter
Generate a filter from a set of attributes. This filter will be suitable for presentation to OBR This means that, due to the way OBR works, it will include a stanza of the form, (mandatory:invalid input: '<'*mandatoryAttribute) Filter strings generated by this method will therefore tend to break the standard OSGi Filter class. The OBR stanza can be stripped out later if required.- Parameters:
attribs-- Returns:
- filter string
-
generateFilter
Generate a filter from a set of attributes. This filter will be suitable for presentation to OBR. This means that, due to the way OBR works, it will include a stanza of the form, (mandatory:invalid input: '<'*mandatoryAttribute) Filter strings generated by this method will therefore tend to break the standard OSGi Filter class. The OBR stanza can be stripped out later if required. We may wish to consider relocating this method since VersionRange has its own top level class.- Parameters:
type-name-attribs-- Returns:
- filter string
-
parseFilter
-