Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml.attr
Class AttributeFactory  view AttributeFactory download AttributeFactory.java

java.lang.Object
  extended bycom.sun.xacml.attr.AttributeFactory
Direct Known Subclasses:
BaseAttributeFactory

public abstract class AttributeFactory
extends java.lang.Object

This is an abstract factory class for creating XACML attribute values. There may be any number of factories available in the system, though there is always one default factory used by the core code.

Since:
1.0

Field Summary
private static AttributeFactoryProxy defaultFactoryProxy
           
 
Constructor Summary
protected AttributeFactory()
          Default constructor.
 
Method Summary
static void addAttributeProxy(java.lang.String id, AttributeProxy proxy)
          Deprecated. As of version 1.2, replaced by addDatatype(String,AttributeProxy) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
abstract  void addDatatype(java.lang.String id, AttributeProxy proxy)
          Adds a proxy to the factory, which in turn will allow new attribute types to be created using the factory.
static AttributeValue createAttribute(org.w3c.dom.Node root)
          Deprecated. As of version 1.2, replaced by createValue(Node) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
static AttributeValue createAttribute(org.w3c.dom.Node root, java.lang.String type)
          Deprecated. As of version 1.2, replaced by createValue(Node,String) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
static AttributeValue createAttribute(org.w3c.dom.Node root, java.net.URI dataType)
          Deprecated. As of version 1.2, replaced by createValue(Node,URI) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
static AttributeValue createAttribute(java.net.URI dataType, java.lang.String value)
          Deprecated. As of version 1.2, replaced by createValue(URI,String) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
abstract  AttributeValue createValue(org.w3c.dom.Node root)
          Creates a value based on the given DOM root node.
abstract  AttributeValue createValue(org.w3c.dom.Node root, java.lang.String type)
          Creates a value based on the given DOM root node and data type.
abstract  AttributeValue createValue(org.w3c.dom.Node root, java.net.URI dataType)
          Creates a value based on the given DOM root node and data type.
abstract  AttributeValue createValue(java.net.URI dataType, java.lang.String value)
          Creates a value based on the given data type and text-encoded value.
static AttributeFactory getInstance()
          Returns the default factory.
abstract  java.util.Set getSupportedDatatypes()
          Returns the datatype identifiers supported by this factory.
static void setDefaultFactory(AttributeFactoryProxy proxy)
          Sets the default factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultFactoryProxy

private static AttributeFactoryProxy defaultFactoryProxy
Constructor Detail

AttributeFactory

protected AttributeFactory()
Default constructor. Used only by subclasses.

Method Detail

getInstance

public static final AttributeFactory getInstance()
Returns the default factory. Depending on the default factory's implementation, this may return a singleton instance or new instances with each invokation.


setDefaultFactory

public static final void setDefaultFactory(AttributeFactoryProxy proxy)
Sets the default factory. Note that this is just a placeholder for now, and will be replaced with a more useful mechanism soon.


addDatatype

public abstract void addDatatype(java.lang.String id,
                                 AttributeProxy proxy)
Adds a proxy to the factory, which in turn will allow new attribute types to be created using the factory. Typically the proxy is provided as an anonymous class that simply calls the getInstance methods (or something similar) of some AttributeValue class.


addAttributeProxy

public static void addAttributeProxy(java.lang.String id,
                                     AttributeProxy proxy)
Deprecated. As of version 1.2, replaced by addDatatype(String,AttributeProxy) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds a proxy to the default factory, which in turn will allow new attribute types to be created using the factory. Typically the proxy is provided as an anonymous class that simply calls the getInstance methods (or something similar) of some AttributeValue class.


getSupportedDatatypes

public abstract java.util.Set getSupportedDatatypes()
Returns the datatype identifiers supported by this factory.


createValue

public abstract AttributeValue createValue(org.w3c.dom.Node root)
                                    throws com.sun.xacml.UnknownIdentifierException,
                                           com.sun.xacml.ParsingException
Creates a value based on the given DOM root node. The type of the attribute is assumed to be present in the node as an XAML attribute named DataType, as is the case with the AttributeValueType in the policy schema. The value is assumed to be the first child of this node.


createAttribute

public static AttributeValue createAttribute(org.w3c.dom.Node root)
                                      throws com.sun.xacml.UnknownIdentifierException,
                                             com.sun.xacml.ParsingException
Deprecated. As of version 1.2, replaced by createValue(Node) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Creates a value based on the given DOM root node. The type of the attribute is assumed to be present in the node as an XAML attribute named DataType, as is the case with the AttributeValueType in the policy schema. The value is assumed to be the first child of this node. This uses the default factory.


createValue

public abstract AttributeValue createValue(org.w3c.dom.Node root,
                                           java.net.URI dataType)
                                    throws com.sun.xacml.UnknownIdentifierException,
                                           com.sun.xacml.ParsingException
Creates a value based on the given DOM root node and data type.


createAttribute

public static AttributeValue createAttribute(org.w3c.dom.Node root,
                                             java.net.URI dataType)
                                      throws com.sun.xacml.UnknownIdentifierException,
                                             com.sun.xacml.ParsingException
Deprecated. As of version 1.2, replaced by createValue(Node,URI) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Creates a value based on the given DOM root node and data type. This uses the default factory.


createValue

public abstract AttributeValue createValue(org.w3c.dom.Node root,
                                           java.lang.String type)
                                    throws com.sun.xacml.UnknownIdentifierException,
                                           com.sun.xacml.ParsingException
Creates a value based on the given DOM root node and data type.


createAttribute

public static AttributeValue createAttribute(org.w3c.dom.Node root,
                                             java.lang.String type)
                                      throws com.sun.xacml.UnknownIdentifierException,
                                             com.sun.xacml.ParsingException
Deprecated. As of version 1.2, replaced by createValue(Node,String) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Creates a value based on the given DOM root node and data type. This uses the default factory.


createValue

public abstract AttributeValue createValue(java.net.URI dataType,
                                           java.lang.String value)
                                    throws com.sun.xacml.UnknownIdentifierException,
                                           com.sun.xacml.ParsingException
Creates a value based on the given data type and text-encoded value. Used primarily by code that does an XPath query to get an attribute value, and then needs to turn the resulting value into an Attribute class.


createAttribute

public static AttributeValue createAttribute(java.net.URI dataType,
                                             java.lang.String value)
                                      throws com.sun.xacml.UnknownIdentifierException,
                                             com.sun.xacml.ParsingException
Deprecated. As of version 1.2, replaced by createValue(URI,String) 55 . The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Creates a value based on the given data type and text-encoded value. Used primarily by code that does an XPath query to get an attribute value, and then needs to turn the resulting value into an Attribute class. This uses the default factory.