Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/attr
In directory sc8-pr-cvs1:/tmp/cvs-serv6049/com/sun/xacml/attr
Modified Files:
AttributeValue.java
Log Message:
Added new Subject interface for RequestCtx and fixed Attribute encoding bug
Index: AttributeValue.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/attr/AttributeValue.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AttributeValue.java 13 Feb 2003 22:19:10 -0000 1.1.1.1
--- AttributeValue.java 22 Jul 2003 15:05:45 -0000 1.2
***************
*** 130,132 ****
--- 130,152 ----
public abstract String encode();
+ /**
+ * Encodes the value and includes the AttributeValue XML tags so that
+ * the resulting string can be included in a valid XACML policy or
+ * Request/Response. The <code>boolean</code> parameter lets you include
+ * the DataType attribute, which is required in a policy but not allowed
+ * in a Request or Response.
+ *
+ * @param includeType include the DataType XML attribute if
+ * <code>true</code>, exclude if <code>false</code>
+ *
+ * @return a <code>String</code> encoding including the XML tags
+ */
+ public String encodeWithTags(boolean includeType) {
+ if (includeType)
+ return "<AttributeValue DataType=\"" + type.toString() + "\">" +
+ encode() + "</AttributeValue>";
+ else
+ return "<AttributeValue>" + encode() + "</AttributeValue>";
+ }
+
}
|