public final class SAMLSchemaBuilder extends Object
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.Modifier and Type | Method and Description |
---|---|
static void |
addExtensionSchema(String schema)
Registers a new schema extension.
|
static List<String> |
getExtensionSchema()
Gets an unmodifiable list of currently registered schema extension.
|
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.
|
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 schemaCopyright © 2018 JBoss by Red Hat. All rights reserved.