Package org.opensaml.saml.common.xml
Class SAMLSchemaBuilder
- java.lang.Object
-
- org.opensaml.saml.common.xml.SAMLSchemaBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SAMLSchemaBuilder.SAML1Version
Identifies which SAML 1.x version is in use.
-
Field Summary
Fields Modifier and Type Field Description private static String[]
baseExtSchemas
Classpath relative location of SAML extension schemas.private static String[]
baseXMLSchemas
Classpath relative location of basic XML schemas.private Schema
cachedSchema
Cached copy of the schema produced by the builder.private org.slf4j.Logger
log
Logger.private static String[]
saml10Schemas
Classpath relative location of SAML 1_0 schemas.private static String[]
saml11Schemas
Classpath relative location of SAML 1_1 schemas.private String[]
saml1xSchemas
Reference to SAML 1.x schemas to apply.private static String[]
saml20Schemas
Classpath relative location of SAML 2_0 schemas.private net.shibboleth.utilities.java.support.xml.SchemaBuilder
schemaBuilder
The builder to use.private static String[]
soapSchemas
Classpath relative location of SOAP 1_1 schemas.private boolean
unresolvedSchemaFatal
Flag indicating whether the failure to resolve a schema resource should be considered fatal.
-
Constructor Summary
Constructors Constructor Description SAMLSchemaBuilder(SAMLSchemaBuilder.SAML1Version ver)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addSchemaToBuilder(String source)
Load the schema from the specified source and add it to the internalSchemaBuilder
.private void
configureBuilder()
Configure the appropriateSchemaBuilder
with the right set of schemas.Schema
getSAMLSchema()
Get a schema that can validate SAML 1.x, 2.0, and all registered extensions.void
setSchemaBuilder(net.shibboleth.utilities.java.support.xml.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 Detail
-
baseXMLSchemas
@Nonnull @NonnullElements @NotEmpty private static String[] baseXMLSchemas
Classpath relative location of basic XML schemas.
-
soapSchemas
@Nonnull @NonnullElements @NotEmpty private static String[] soapSchemas
Classpath relative location of SOAP 1_1 schemas.
-
saml10Schemas
@Nonnull @NonnullElements @NotEmpty private static String[] saml10Schemas
Classpath relative location of SAML 1_0 schemas.
-
saml11Schemas
@Nonnull @NonnullElements @NotEmpty private static String[] saml11Schemas
Classpath relative location of SAML 1_1 schemas.
-
saml20Schemas
@Nonnull @NonnullElements @NotEmpty private static String[] saml20Schemas
Classpath relative location of SAML 2_0 schemas.
-
baseExtSchemas
@Nonnull @NonnullElements @NotEmpty private static String[] baseExtSchemas
Classpath relative location of SAML extension schemas.
-
log
private org.slf4j.Logger log
Logger.
-
unresolvedSchemaFatal
private boolean unresolvedSchemaFatal
Flag indicating whether the failure to resolve a schema resource should be considered fatal.
-
cachedSchema
@Nullable private Schema cachedSchema
Cached copy of the schema produced by the builder.
-
saml1xSchemas
@Nonnull @NonnullElements @NotEmpty private String[] saml1xSchemas
Reference to SAML 1.x schemas to apply.
-
schemaBuilder
@Nonnull private net.shibboleth.utilities.java.support.xml.SchemaBuilder schemaBuilder
The builder to use.
-
-
Constructor Detail
-
SAMLSchemaBuilder
public SAMLSchemaBuilder(@Nonnull @ParameterName(name="ver") SAMLSchemaBuilder.SAML1Version ver)
Constructor.A default
SchemaBuilder
is constructed, and injected with aClasspathResolver
for resolving supplementary schemas.- Parameters:
ver
- the SAML 1.x version to use
-
-
Method Detail
-
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
public void setSchemaBuilder(@Nonnull net.shibboleth.utilities.java.support.xml.SchemaBuilder builder)
Set a customSchemaBuilder
to use.- Parameters:
builder
- SchemaBuilder to use
-
getSAMLSchema
@Nonnull public Schema getSAMLSchema() throws SAXException
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
private void addSchemaToBuilder(@Nonnull String source)
Load the schema from the specified source and add it to the internalSchemaBuilder
.- Parameters:
source
- the schema resource path
-
-