Package org.apache.felix.utils.resource
Class ResourceBuilder
java.lang.Object
org.apache.felix.utils.resource.ResourceBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final char
private static final int
private static final int
static final String
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceImpl
static ResourceImpl
static ResourceImpl
static ResourceImpl
build
(ResourceImpl resource, String uri, Map<String, String> headerMap, boolean removeServiceRequirements) private static char
private static List
<org.osgi.resource.Capability> convertExports
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static List
<org.osgi.resource.Capability> convertExportService
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static List
<org.osgi.resource.Requirement> convertImports
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static List
<org.osgi.resource.Requirement> convertImportService
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static List
<org.osgi.resource.Capability> convertProvideCapabilities
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static List
<org.osgi.resource.Requirement> convertRequireCapabilities
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static List
<org.osgi.resource.Requirement> convertRequires
(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) private static ResourceImpl
doBuild
(ResourceImpl resource, String uri, Map<String, String> headerMap, boolean removeServiceRequirements) private static String
getBreeVersionClause
(org.osgi.framework.Version ver) private static String
getManifestVersion
(Map<String, String> headerMap) private static List
<ResourceBuilder.ParsedHeaderClause> private static List
<ResourceBuilder.ParsedHeaderClause> normalizeExportClauses
(List<ResourceBuilder.ParsedHeaderClause> clauses, String bsn, org.osgi.framework.Version bv) private static List
<ResourceBuilder.ParsedHeaderClause> private static List
<ResourceBuilder.ParsedHeaderClause> private static List
<ResourceBuilder.ParsedHeaderClause> private static List
<ResourceBuilder.ParsedHeaderClause> private static List
<org.osgi.resource.Requirement> parseBreeHeader
(String header, org.osgi.resource.Resource resource) private static ResourceBuilder.ParsedHeaderClause
parseBundleSymbolicName
(Map<String, String> headerMap) static List
<org.osgi.resource.Capability> parseCapability
(org.osgi.resource.Resource resource, String capability) parseDelimitedString
(String value, String delim) parseDelimitedString
(String value, String delim, boolean trim) Parses delimited string and returns an array containing the tokens.private static List
<RequirementImpl> parseFragmentHost
(org.osgi.resource.Resource resource, Map<String, String> headerMap) static List
<org.osgi.resource.Requirement> parseRequirement
(org.osgi.resource.Resource resource, String requirement) private static List
<ResourceBuilder.ParsedHeaderClause> parseStandardHeader
(String header)
-
Field Details
-
RESOLUTION_DYNAMIC
- See Also:
-
EOF
private static final char EOF- See Also:
-
CLAUSE_START
private static final int CLAUSE_START- See Also:
-
PARAMETER_START
private static final int PARAMETER_START- See Also:
-
KEY
private static final int KEY- See Also:
-
DIRECTIVE_OR_TYPEDATTRIBUTE
private static final int DIRECTIVE_OR_TYPEDATTRIBUTE- See Also:
-
ARGUMENT
private static final int ARGUMENT- See Also:
-
VALUE
private static final int VALUE- See Also:
-
CHAR
private static final int CHAR- See Also:
-
DELIMITER
private static final int DELIMITER- See Also:
-
STARTQUOTE
private static final int STARTQUOTE- See Also:
-
ENDQUOTE
private static final int ENDQUOTE- See Also:
-
DEFAULT_DIRECTIVES
-
-
Constructor Details
-
ResourceBuilder
private ResourceBuilder()
-
-
Method Details
-
build
public static ResourceImpl build(String uri, Map<String, String> headerMap) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
build
public static ResourceImpl build(String uri, Map<String, String> headerMap, boolean removeServiceRequirements) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
build
public static ResourceImpl build(ResourceImpl resource, String uri, Map<String, String> headerMap) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
build
public static ResourceImpl build(ResourceImpl resource, String uri, Map<String, String> headerMap, boolean removeServiceRequirements) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
doBuild
private static ResourceImpl doBuild(ResourceImpl resource, String uri, Map<String, String> headerMap, boolean removeServiceRequirements) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
parseRequirement
public static List<org.osgi.resource.Requirement> parseRequirement(org.osgi.resource.Resource resource, String requirement) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
parseCapability
public static List<org.osgi.resource.Capability> parseCapability(org.osgi.resource.Resource resource, String capability) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
normalizeImportClauses
private static List<ResourceBuilder.ParsedHeaderClause> normalizeImportClauses(List<ResourceBuilder.ParsedHeaderClause> clauses) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
convertExportService
private static List<org.osgi.resource.Capability> convertExportService(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) -
convertImportService
private static List<org.osgi.resource.Requirement> convertImportService(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
convertImports
private static List<org.osgi.resource.Requirement> convertImports(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) -
normalizeDynamicImportClauses
private static List<ResourceBuilder.ParsedHeaderClause> normalizeDynamicImportClauses(List<ResourceBuilder.ParsedHeaderClause> clauses) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
normalizeRequireCapabilityClauses
private static List<ResourceBuilder.ParsedHeaderClause> normalizeRequireCapabilityClauses(List<ResourceBuilder.ParsedHeaderClause> clauses) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
normalizeProvideCapabilityClauses
private static List<ResourceBuilder.ParsedHeaderClause> normalizeProvideCapabilityClauses(List<ResourceBuilder.ParsedHeaderClause> clauses) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
convertRequireCapabilities
private static List<org.osgi.resource.Requirement> convertRequireCapabilities(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
convertProvideCapabilities
private static List<org.osgi.resource.Capability> convertProvideCapabilities(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
normalizeExportClauses
private static List<ResourceBuilder.ParsedHeaderClause> normalizeExportClauses(List<ResourceBuilder.ParsedHeaderClause> clauses, String bsn, org.osgi.framework.Version bv) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
convertExports
private static List<org.osgi.resource.Capability> convertExports(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) -
getManifestVersion
-
parseBundleSymbolicName
private static ResourceBuilder.ParsedHeaderClause parseBundleSymbolicName(Map<String, String> headerMap) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
parseFragmentHost
private static List<RequirementImpl> parseFragmentHost(org.osgi.resource.Resource resource, Map<String, String> headerMap) throws org.osgi.framework.BundleException- Throws:
org.osgi.framework.BundleException
-
parseBreeHeader
-
getBreeVersionClause
-
normalizeRequireClauses
private static List<ResourceBuilder.ParsedHeaderClause> normalizeRequireClauses(List<ResourceBuilder.ParsedHeaderClause> clauses) -
convertRequires
private static List<org.osgi.resource.Requirement> convertRequires(List<ResourceBuilder.ParsedHeaderClause> clauses, org.osgi.resource.Resource resource) -
charAt
-
parseStandardHeader
-
parseDelimitedString
-
parseDelimitedString
Parses delimited string and returns an array containing the tokens. This parser obeys quotes, so the delimiter character will be ignored if it is inside of a quote. This method assumes that the quote character is not included in the set of delimiter characters.- Parameters:
value
- the delimited string to parse.delim
- the characters delimiting the tokens.trim
- true to trim the string, false else.- Returns:
- a list of string or an empty list if there are none.
-