org.apache.felix.bundlerepository.impl
Class DataModelHelperImpl

java.lang.Object
  extended by org.apache.felix.bundlerepository.impl.DataModelHelperImpl
All Implemented Interfaces:
DataModelHelper

public class DataModelHelperImpl
extends java.lang.Object
implements DataModelHelper


Field Summary
static java.lang.String BUNDLE_LICENSE
           
static java.lang.String BUNDLE_SOURCE
           
 
Constructor Summary
DataModelHelperImpl()
           
 
Method Summary
 Capability capability(java.lang.String name, java.util.Map properties)
          Create a capability
 Resource createResource(java.util.jar.Attributes attributes)
          Create a resource corresponding to the given manifest entries.
 Resource createResource(org.osgi.framework.Bundle bundle)
          Create a resource corresponding to the given bundle.
 ResourceImpl createResource(org.apache.felix.bundlerepository.impl.DataModelHelperImpl.Headers headers)
           
 Resource createResource(java.net.URL bundleUrl)
          Create a resource for the bundle located at the given location.
 org.osgi.framework.Filter filter(java.lang.String filter)
          Create an extender filter supporting the SUBSET, SUPERSET and other extensions
 Capability readCapability(java.io.Reader reader)
           
 Capability readCapability(java.lang.String xml)
           
 Property readProperty(java.io.Reader reader)
           
 Property readProperty(java.lang.String xml)
           
 Repository readRepository(java.io.Reader reader)
           
 Repository readRepository(java.lang.String xml)
           
 Requirement readRequirement(java.io.Reader reader)
           
 Requirement readRequirement(java.lang.String xml)
           
 Resource readResource(java.io.Reader reader)
           
 Resource readResource(java.lang.String xml)
           
 RepositoryImpl repository(java.io.InputStream is)
           
 Repository repository(Resource[] resources)
          Create a repository for the given set of resources.
 Repository repository(java.net.URL url)
          Create a repository from the specified URL.
 Requirement requirement(java.lang.String name, java.lang.String filter)
          Create a simple requirement to be used for selection
 java.lang.String writeCapability(Capability capability)
           
 void writeCapability(Capability capability, java.io.Writer writer)
           
 java.lang.String writeProperty(Property property)
           
 void writeProperty(Property property, java.io.Writer writer)
           
 java.lang.String writeRepository(Repository repository)
           
 void writeRepository(Repository repository, java.io.Writer writer)
           
 java.lang.String writeRequirement(Requirement requirement)
           
 void writeRequirement(Requirement requirement, java.io.Writer writer)
           
 java.lang.String writeResource(Resource resource)
           
 void writeResource(Resource resource, java.io.Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_LICENSE

public static final java.lang.String BUNDLE_LICENSE
See Also:
Constant Field Values

BUNDLE_SOURCE

public static final java.lang.String BUNDLE_SOURCE
See Also:
Constant Field Values
Constructor Detail

DataModelHelperImpl

public DataModelHelperImpl()
Method Detail

requirement

public Requirement requirement(java.lang.String name,
                               java.lang.String filter)
Description copied from interface: DataModelHelper
Create a simple requirement to be used for selection

Specified by:
requirement in interface DataModelHelper
Returns:

filter

public org.osgi.framework.Filter filter(java.lang.String filter)
Description copied from interface: DataModelHelper
Create an extender filter supporting the SUBSET, SUPERSET and other extensions

Specified by:
filter in interface DataModelHelper
Parameters:
filter - the string filter
Returns:

repository

public Repository repository(java.net.URL url)
                      throws java.lang.Exception
Description copied from interface: DataModelHelper
Create a repository from the specified URL.

Specified by:
repository in interface DataModelHelper
Returns:
Throws:
java.lang.Exception

repository

public RepositoryImpl repository(java.io.InputStream is)
                          throws java.lang.Exception
Throws:
java.lang.Exception

repository

public Repository repository(Resource[] resources)
Description copied from interface: DataModelHelper
Create a repository for the given set of resources. Such repositories can be used to create a resolver that would resolve on a subset of available resources instead of all of them.

Specified by:
repository in interface DataModelHelper
Parameters:
resources - an array of resources
Returns:
a repository containing the given resources

capability

public Capability capability(java.lang.String name,
                             java.util.Map properties)
Description copied from interface: DataModelHelper
Create a capability

Specified by:
capability in interface DataModelHelper
Parameters:
name - name of this capability
properties - the properties
Returns:
a new capability with the specified name and properties

writeRepository

public java.lang.String writeRepository(Repository repository)
Specified by:
writeRepository in interface DataModelHelper

writeRepository

public void writeRepository(Repository repository,
                            java.io.Writer writer)
                     throws java.io.IOException
Specified by:
writeRepository in interface DataModelHelper
Throws:
java.io.IOException

writeResource

public java.lang.String writeResource(Resource resource)
Specified by:
writeResource in interface DataModelHelper

writeResource

public void writeResource(Resource resource,
                          java.io.Writer writer)
                   throws java.io.IOException
Specified by:
writeResource in interface DataModelHelper
Throws:
java.io.IOException

writeCapability

public java.lang.String writeCapability(Capability capability)
Specified by:
writeCapability in interface DataModelHelper

writeCapability

public void writeCapability(Capability capability,
                            java.io.Writer writer)
                     throws java.io.IOException
Specified by:
writeCapability in interface DataModelHelper
Throws:
java.io.IOException

writeRequirement

public java.lang.String writeRequirement(Requirement requirement)
Specified by:
writeRequirement in interface DataModelHelper

writeRequirement

public void writeRequirement(Requirement requirement,
                             java.io.Writer writer)
                      throws java.io.IOException
Specified by:
writeRequirement in interface DataModelHelper
Throws:
java.io.IOException

writeProperty

public java.lang.String writeProperty(Property property)
Specified by:
writeProperty in interface DataModelHelper

writeProperty

public void writeProperty(Property property,
                          java.io.Writer writer)
                   throws java.io.IOException
Specified by:
writeProperty in interface DataModelHelper
Throws:
java.io.IOException

createResource

public Resource createResource(org.osgi.framework.Bundle bundle)
Description copied from interface: DataModelHelper
Create a resource corresponding to the given bundle.

Specified by:
createResource in interface DataModelHelper
Parameters:
bundle - the bundle
Returns:
the corresponding resource

createResource

public Resource createResource(java.net.URL bundleUrl)
                        throws java.io.IOException
Description copied from interface: DataModelHelper
Create a resource for the bundle located at the given location.

Specified by:
createResource in interface DataModelHelper
Parameters:
bundleUrl - the location of the bundle
Returns:
the corresponding resource
Throws:
java.io.IOException

createResource

public Resource createResource(java.util.jar.Attributes attributes)
Description copied from interface: DataModelHelper
Create a resource corresponding to the given manifest entries.

Specified by:
createResource in interface DataModelHelper
Parameters:
attributes - the manifest headers
Returns:
the corresponding resource

createResource

public ResourceImpl createResource(org.apache.felix.bundlerepository.impl.DataModelHelperImpl.Headers headers)

readRepository

public Repository readRepository(java.lang.String xml)
                          throws java.lang.Exception
Specified by:
readRepository in interface DataModelHelper
Throws:
java.lang.Exception

readRepository

public Repository readRepository(java.io.Reader reader)
                          throws java.lang.Exception
Specified by:
readRepository in interface DataModelHelper
Throws:
java.lang.Exception

readResource

public Resource readResource(java.lang.String xml)
                      throws java.lang.Exception
Specified by:
readResource in interface DataModelHelper
Throws:
java.lang.Exception

readResource

public Resource readResource(java.io.Reader reader)
                      throws java.lang.Exception
Specified by:
readResource in interface DataModelHelper
Throws:
java.lang.Exception

readCapability

public Capability readCapability(java.lang.String xml)
                          throws java.lang.Exception
Specified by:
readCapability in interface DataModelHelper
Throws:
java.lang.Exception

readCapability

public Capability readCapability(java.io.Reader reader)
                          throws java.lang.Exception
Specified by:
readCapability in interface DataModelHelper
Throws:
java.lang.Exception

readRequirement

public Requirement readRequirement(java.lang.String xml)
                            throws java.lang.Exception
Specified by:
readRequirement in interface DataModelHelper
Throws:
java.lang.Exception

readRequirement

public Requirement readRequirement(java.io.Reader reader)
                            throws java.lang.Exception
Specified by:
readRequirement in interface DataModelHelper
Throws:
java.lang.Exception

readProperty

public Property readProperty(java.lang.String xml)
                      throws java.lang.Exception
Specified by:
readProperty in interface DataModelHelper
Throws:
java.lang.Exception

readProperty

public Property readProperty(java.io.Reader reader)
                      throws java.lang.Exception
Specified by:
readProperty in interface DataModelHelper
Throws:
java.lang.Exception


Copyright © 2011. All Rights Reserved.