Source code: com/sun/xacml/attr/AttributeProxy.java
1
2 /*
3 * @(#)AttributeProxy.java
4 *
5 * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistribution of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
12 *
13 * 2. Redistribution in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * Neither the name of Sun Microsystems, Inc. or the names of contributors may
18 * be used to endorse or promote products derived from this software without
19 * specific prior written permission.
20 *
21 * This software is provided "AS IS," without a warranty of any kind. ALL
22 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
23 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
24 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
25 * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
26 * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
27 * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
28 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
29 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
30 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
31 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * You acknowledge that this software is not designed or intended for use in
34 * the design, construction, operation or maintenance of any nuclear facility.
35 */
36
37 package com.sun.xacml.attr;
38
39 import org.w3c.dom.Node;
40
41
42 /**
43 * Used by the <code>AttributeFactory</code> to create new attributes.
44 * Typically a new proxy class is created which in turn knows how to create
45 * a specific kind of attribute, and then this proxy class is installed in
46 * the <code>AttributeFactory</code>.
47 *
48 * @since 1.0
49 * @author Seth Proctor
50 */
51 public interface AttributeProxy
52 {
53
54 /**
55 * Tries to create a new <code>AttributeValue</code> based on the given
56 * DOM root node.
57 *
58 * @param root the DOM root of some attribute data
59 *
60 * @return an <code>AttributeValue</code> representing the given data
61 *
62 * @throws Exception if the data couldn't be used (the exception is
63 * typically wrapping some other exception)
64 */
65 public AttributeValue getInstance(Node root) throws Exception;
66
67 /**
68 * Tries to create a new <code>AttributeValue</code> based on the given
69 * String data.
70 *
71 * @param value the text form of some attribute data
72 *
73 * @return an <code>AttributeValue</code> representing the given data
74 *
75 * @throws Exception if the data couldn't be used (the exception is
76 * typically wrapping some other exception)
77 */
78 public AttributeValue getInstance(String value) throws Exception;
79
80 }