|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensaml.common.xml.SAMLSchemaBuilder
public final class SAMLSchemaBuilder
A convenience builder for creating Schema
s for validating SAML 1_0, 1_1, and 2_0.
Additional schema may be registered by addExtensionSchema(String)
with the given argument a relative or
absolute path that will be resolved against the classpath. Note that relative paths are relative to this
class. Also, schema files must be provided in the order they are referenced, that is if schema B depends on schema A
then schema A must appear first in the list of registered extension schemas.
Schemas may use a schema location attribute. These schema locations will be resolved by the ClasspathResolver
.
If schema locations are used they will be resolved and will meet the aformentioned schema ordering requirement.
The schema objects produced here are thread safe and should be re-used, to that end the schema builder will cache
created schema using SoftReference
s, allowing the VM to reclaim the memory used by schemas if necessary.
Field Summary | |
---|---|
private static String[] |
baseExtSchemas
Classpath relative location of SAML extension schemas. |
private static String[] |
baseXMLSchemas
Classpath relative location of basic XML schemas. |
private static List<String> |
extensionSchema
Additional schema locations relative to classpath. |
private static SoftReference<Schema> |
saml10Schema
SAML 1_0 Schema with SAML 2_0 schemas and extensions. |
private static String[] |
saml10Schemas
Classpath relative location of SAML 1_0 schemas. |
private static SoftReference<Schema> |
saml11Schema
SAML 1_0 Schema with SAML 2_0 schemas and extensions. |
private static String[] |
saml11Schemas
Classpath relative location of SAML 1_1 schemas. |
private static String[] |
saml20Schemas
Classpath relative location of SAML 2_0 schemas. |
private static String[] |
soapSchemas
Classpath relative location of SOAP 1_1 schemas. |
Constructor Summary | |
---|---|
private |
SAMLSchemaBuilder()
Constructor. |
Method Summary | |
---|---|
static void |
addExtensionSchema(String schema)
Registers a new schema extension. |
private static Schema |
buildSchema(String[] saml1Schema)
Builds a schema object based on the given SAML 1_X schema set. |
static List<String> |
getExtensionSchema()
Gets an unmodifiable list of currently registered schema extensions. |
static Schema |
getSAML10Schema()
Gets a schema that can validate SAML 1.0, 2.0, and all registered extensions. |
static Schema |
getSAML11Schema()
Gets a schema that can validate SAML 1.1, 2.0, and all registered extensions. |
static void |
removeSchema(String schema)
Removes a currently registered schema. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static SoftReference<Schema> saml10Schema
private static SoftReference<Schema> saml11Schema
private static String[] baseXMLSchemas
private static String[] soapSchemas
private static String[] saml10Schemas
private static String[] saml11Schemas
private static String[] saml20Schemas
private static String[] baseExtSchemas
private static List<String> extensionSchema
Constructor Detail |
---|
private SAMLSchemaBuilder()
Method Detail |
---|
public static Schema getSAML10Schema() throws SAXException
SAXException
- thrown if a schema object can not be createdpublic static Schema getSAML11Schema() throws SAXException
SAXException
- thrown if a schema object can not be createdpublic static List<String> getExtensionSchema()
public static void addExtensionSchema(String schema)
schema
- new schema extensionpublic static void removeSchema(String schema)
schema
- currently registered schemaprivate static Schema buildSchema(String[] saml1Schema) throws SAXException
saml1Schema
- SAML 1_X schema set
SAXException
- thrown if a schema object can not be created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |