|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.security.PolicyParser
public class PolicyParser
A validating parser for XACML policies.
This class also provides a commandline XACML validation utility.
NOTE: Although instances may be re-used, this class is not thread-safe.
Use the copy() method to support concurrent parsing.
| Nested Class Summary | |
|---|---|
static class |
PolicyParser.ThrowAllErrorHandler
This class is a workaround to some shift in the behavior of anonymous inner classes |
| Constructor Summary | |
|---|---|
PolicyParser(InputStream schemaStream)
Creates an instance that will validate according to the given schema. |
|
| Method Summary | |
|---|---|
PolicyParser |
copy()
Gets a new instance that uses the same schema as this one. |
static void |
main(String[] args)
Command-line utility for validating XACML policies. |
com.sun.xacml.AbstractPolicy |
parse(InputStream policyStream,
boolean schemaValidate)
Parses the given policy and optionally schema validates it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PolicyParser(InputStream schemaStream)
throws IOException,
SAXException
schemaStream - the XSD schema to use for schema validation
IOException - if the schema can't be read
SAXException - if the schema isn't valid| Method Detail |
|---|
public PolicyParser copy()
public com.sun.xacml.AbstractPolicy parse(InputStream policyStream,
boolean schemaValidate)
throws ValidationException
policyStream - the serialized XACML policyvalidate - whether to schema validate
ValidationException - if the given xml is not a valid policy. This will occur if it
is not well-formed XML, its root element is not named
Policy or PolicySet, it triggers
a parse exception in the Sun libraries when constructing an
AbstractPolicy from the DOM, or (if validation
is true) it is not schema-valid.public static void main(String[] args)
Accepts a single argument: the path to the policy instance to validate.
Also requires that the com.sun.xacml.PolicySchema system property points to the XACML schema.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||