Package org.opensaml.saml.common.xml
Class SAMLSchemaBuilder
java.lang.Object
org.opensaml.saml.common.xml.SAMLSchemaBuilder
A convenience builder for creating
Schema
s for validating SAML 1.0, 1.1, and 2.0.
Additional schemas may be included in the resulting object by supplying their locations
to an injected SchemaBuilder
object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Identifies which SAML 1.x version is in use. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static String[]
Classpath relative location of SAML extension schemas.private static String[]
Classpath relative location of basic XML schemas.private Schema
Cached copy of the schema produced by the builder.private org.slf4j.Logger
Logger.private static String[]
Classpath relative location of SAML 1_0 schemas.private static String[]
Classpath relative location of SAML 1_1 schemas.private String[]
Reference to SAML 1.x schemas to apply.private static String[]
Classpath relative location of the invariant SAML 2.0 schemas.private static String[]
Classpath relative location of SAML 2_0 schemas.private static String[]
Classpath relative location of SAML 2_0 schemas with strict string/anyURI types.private String[]
Reference to SAML 2.0 schemas to apply.private SchemaBuilder
The builder to use.private static String[]
Classpath relative location of SOAP 1_1 schemas.private boolean
Flag indicating whether the failure to resolve a schema resource should be considered fatal. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SAMLSchemaBuilder
(SAMLSchemaBuilder.SAML1Version ver, boolean strict) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addSchemaToBuilder
(String source) Load the schema from the specified source and add it to the internalSchemaBuilder
.private void
Configure the appropriateSchemaBuilder
with the right set of schemas.Get a schema that can validate SAML 1.x, 2.0, and all registered extensions.void
setSchemaBuilder
(SchemaBuilder builder) Set a customSchemaBuilder
to use.void
setUnresolvedSchemaFatal
(boolean flag) Set the flag indicating whether the failure to resolve a schema resource should be considered fatal.
-
Field Details
-
baseXMLSchemas
Classpath relative location of basic XML schemas. -
soapSchemas
Classpath relative location of SOAP 1_1 schemas. -
saml10Schemas
Classpath relative location of SAML 1_0 schemas. -
saml11Schemas
Classpath relative location of SAML 1_1 schemas. -
saml20CommonSchemas
Classpath relative location of the invariant SAML 2.0 schemas. -
saml20Schemas
Classpath relative location of SAML 2_0 schemas. -
saml20StrictSchemas
Classpath relative location of SAML 2_0 schemas with strict string/anyURI types. -
baseExtSchemas
Classpath relative location of SAML extension schemas. -
log
@Nonnull private org.slf4j.Logger logLogger. -
unresolvedSchemaFatal
private boolean unresolvedSchemaFatalFlag indicating whether the failure to resolve a schema resource should be considered fatal. -
cachedSchema
Cached copy of the schema produced by the builder. -
saml1xSchemas
Reference to SAML 1.x schemas to apply. -
saml2Schemas
Reference to SAML 2.0 schemas to apply. -
schemaBuilder
The builder to use.
-
-
Constructor Details
-
SAMLSchemaBuilder
Constructor.A default
SchemaBuilder
is constructed, and injected with aClasspathResolver
for resolving supplementary schemas.- Parameters:
ver
- the SAML 1.x version to use
-
SAMLSchemaBuilder
public SAMLSchemaBuilder(@Nonnull @ParameterName(name="ver") SAMLSchemaBuilder.SAML1Version ver, @ParameterName(name="strict") boolean strict) Constructor.A default
SchemaBuilder
is constructed, and injected with aClasspathResolver
for resolving supplementary schemas.- Parameters:
ver
- the SAML 1.x version to usestrict
- whether to apply modified schemas with strict string and anyURI type definitions- Since:
- 4.1.0
-
-
Method Details
-
setUnresolvedSchemaFatal
public void setUnresolvedSchemaFatal(boolean flag) Set the flag indicating whether the failure to resolve a schema resource should be considered fatal.Default value: true.
- Parameters:
flag
- true if should be fatal, false if not
-
setSchemaBuilder
Set a customSchemaBuilder
to use.- Parameters:
builder
- SchemaBuilder to use
-
getSAMLSchema
Get a schema that can validate SAML 1.x, 2.0, and all registered extensions.- Returns:
- schema
- Throws:
SAXException
- thrown if a schema object cannot be created
-
configureBuilder
@Nonnull private void configureBuilder()Configure the appropriateSchemaBuilder
with the right set of schemas. -
addSchemaToBuilder
Load the schema from the specified source and add it to the internalSchemaBuilder
.- Parameters:
source
- the schema resource path
-