org.apache.neethi
Class PolicyBuilder

java.lang.Object
  extended by org.apache.neethi.PolicyBuilder

public class PolicyBuilder
extends Object

PolicyBuilder provides set of methods to create a Policy object from an InputStream, Element, XMLStreamReader, OMElement, etc.. It maintains an instance of AssertionBuilderFactory that can return AssertionBuilders that can create a Domain Assertion out of an element. These AssertionBuilders are used when constructing a Policy object.


Field Summary
protected  PolicyRegistry defaultPolicyRegistry
           
protected  AssertionBuilderFactory factory
           
 
Constructor Summary
PolicyBuilder()
           
PolicyBuilder(AssertionBuilderFactory factory)
           
 
Method Summary
 AssertionBuilderFactory getAssertionBuilderFactory()
           
 Policy getPolicy(Element el)
           
 Policy getPolicy(InputStream inputStream)
          Creates a Policy object from an InputStream.
 Policy getPolicy(Object element)
          Creates a Policy object from an element.
 Policy getPolicy(javax.xml.stream.XMLStreamReader reader)
           
 PolicyReference getPolicyReference(InputStream inputStream)
          Creates a PolicyReference object.
 PolicyReference getPolicyReference(Object element)
          Creates a PolicyReference object from an element.
 PolicyRegistry getPolicyRegistry()
          The PolicyEngine can have a default PolicyRegistry that the Policy objects that it creates are setup to use when normalize is called without the PolicyRegistry.
protected  void notifyUnknownPolicyElement(Object childElement)
           
 void registerBuilder(QName qname, AssertionBuilder<?> builder)
          Registers an AssertionBuilder instances and associates it with a QName.
 void setPolicyRegistry(PolicyRegistry reg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected AssertionBuilderFactory factory

defaultPolicyRegistry

protected PolicyRegistry defaultPolicyRegistry
Constructor Detail

PolicyBuilder

public PolicyBuilder()

PolicyBuilder

public PolicyBuilder(AssertionBuilderFactory factory)
Method Detail

registerBuilder

public void registerBuilder(QName qname,
                            AssertionBuilder<?> builder)
Registers an AssertionBuilder instances and associates it with a QName. PolicyManager or other AssertionBuilders instances can use this AssertionBuilder instance to process and build an Assertion from a element with the specified QName.

Parameters:
qname - the QName of the Assertion that the Builder can build
builder - the AssertionBuilder that can build assertions that of 'qname' type

getPolicyRegistry

public PolicyRegistry getPolicyRegistry()
The PolicyEngine can have a default PolicyRegistry that the Policy objects that it creates are setup to use when normalize is called without the PolicyRegistry.

Returns:
the default PolicyRegistry

setPolicyRegistry

public void setPolicyRegistry(PolicyRegistry reg)

getAssertionBuilderFactory

public AssertionBuilderFactory getAssertionBuilderFactory()

getPolicy

public Policy getPolicy(InputStream inputStream)
Creates a Policy object from an InputStream.

Parameters:
inputStream - the InputStream of the Policy
Returns:
a Policy object of the Policy that is fed as a InputStream

getPolicy

public Policy getPolicy(Element el)

getPolicy

public Policy getPolicy(javax.xml.stream.XMLStreamReader reader)

getPolicy

public Policy getPolicy(Object element)
Creates a Policy object from an element.

Parameters:
element - the Policy element
Returns:
a Policy object of the Policy element

getPolicyReference

public PolicyReference getPolicyReference(InputStream inputStream)
Creates a PolicyReference object.

Parameters:
inputStream - the InputStream of the PolicyReference
Returns:
a PolicyReference object of the PolicyReference

getPolicyReference

public PolicyReference getPolicyReference(Object element)
Creates a PolicyReference object from an element.

Parameters:
element - the PolicyReference element
Returns:
a PolicyReference object of the PolicyReference element

notifyUnknownPolicyElement

protected void notifyUnknownPolicyElement(Object childElement)


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.