Package net.shibboleth.metadata.dom
Class AbstractXSLProcessingStage
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<Element>
net.shibboleth.metadata.dom.AbstractXSLProcessingStage
- All Implemented Interfaces:
Stage<Element>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
- Direct Known Subclasses:
MultiOutputXSLTransformationStage,XSLTransformationStage,XSLValidationStage
An abstract stage which applies an XSL transformation to each element in the
DOMElementItem collection.
This stage requires the following properties be set prior to initialization:
xslResource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassTransformerErrorListenerthat sets anErrorStatus,WarningStatusorInfoStatuson itsItemdepending on theTransformerExceptionmessage. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.LoggerClass logger.Attributes set on theTransformerused by this stage.Features set on theTransformerused by this stage.Collection of named parameters to make available to the transform.private URIResolverURIResolverto use in the transformer.private ResourceResource that provides the XSL document.private TemplatesXSL template used to transformElements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms the stage processing on the given Item collection.protected voidprotected abstract voidexecuteTransformer(Transformer transformer, Collection<Item<Element>> items) Executes the XSLT transform on the given collection of Items.Gets the unmodifiable collection of attributes used by the XSLT transformer.Gets the unmodifiable collection of features used by the XSLT transformer.Gets the unmodifiable collection of parameters used by the XSLT transformer.final URIResolverGets theURIResolverset for this transform, if any.final ResourceGets the resource that provides the XSL document.private TemplatesGet the shared templates object.voidsetTransformAttributes(Map<String, Object> attributes) Sets the collection of attributes used by the XSLT transformer.voidsetTransformFeatures(Map<String, Boolean> features) Sets the collection of features used by the XSLT transformer.voidsetTransformParameters(Map<String, Object> parameters) Sets the named parameters for the transform.voidsetURIResolver(URIResolver resolver) Set theURIResolverfor this transform, ornullto specify none.voidsetXSLResource(Resource resource) Sets the resource that provides the XSL document.Methods inherited from class net.shibboleth.metadata.pipeline.AbstractStage
execute, getCollectionPredicate, setCollectionPredicateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger. -
xslResource
Resource that provides the XSL document. -
xslTemplate
XSL template used to transformElements.A single shared
Templatesobject is constructed from thexslResource,transformAttributes,transformFeaturesand anyuriResolverduring initialisation of the stage. -
transformAttributes
Attributes set on theTransformerused by this stage. -
transformFeatures
Features set on theTransformerused by this stage. -
transformParameters
Collection of named parameters to make available to the transform. If not set, an empty collection. -
uriResolver
URIResolverto use in the transformer. Default value:null.
-
-
Constructor Details
-
AbstractXSLProcessingStage
public AbstractXSLProcessingStage()
-
-
Method Details
-
getXSLResource
Gets the resource that provides the XSL document.- Returns:
- resource that provides the XSL document
-
setXSLResource
Sets the resource that provides the XSL document.- Parameters:
resource- resource that provides the XSL document
-
getXSLTemplate
Get the shared templates object.- Returns:
- the shared templates object
-
getTransformAttributes
Gets the unmodifiable collection of attributes used by the XSLT transformer.- Returns:
- unmodifiable collection of attributes used by the XSLT transformer, never null nor containing null keys
-
setTransformAttributes
public void setTransformAttributes(@Nonnull @NonnullElements @Unmodifiable Map<String, Object> attributes) Sets the collection of attributes used by the XSLT transformer.- Parameters:
attributes- collection of attributes used by the XSLT transformer, may be null or contain null keys
-
getTransformFeatures
Gets the unmodifiable collection of features used by the XSLT transformer.- Returns:
- unmodifiable collection of features used by the XSLT transformer, never null nor containing null keys
-
setTransformFeatures
public void setTransformFeatures(@Nonnull @NonnullElements @Unmodifiable Map<String, Boolean> features) Sets the collection of features used by the XSLT transformer.- Parameters:
features- collection of features used by the XSLT transformer, may be null or contain null keys
-
getTransformParameters
Gets the unmodifiable collection of parameters used by the XSLT transformer.- Returns:
- parameters used by the XSLT transformer, never null nor containing null keys
-
setTransformParameters
public void setTransformParameters(@Nonnull @NonnullElements @Unmodifiable Map<String, Object> parameters) Sets the named parameters for the transform.- Parameters:
parameters- parameters for the transform, may be null or contain null keys
-
getURIResolver
Gets theURIResolverset for this transform, if any.- Returns:
- the
URIResolver, ornull
-
setURIResolver
Set theURIResolverfor this transform, ornullto specify none.- Parameters:
resolver- theURIResolverto use, ornull
-
doExecute
protected void doExecute(@Nonnull @NonnullElements List<Item<Element>> items) throws StageProcessingException Description copied from class:AbstractStagePerforms the stage processing on the given Item collection.The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
- Specified by:
doExecutein classAbstractStage<Element>- Parameters:
items- collection to be processed- Throws:
StageProcessingException- thrown if there is an unrecoverable problem when processing the stage
-
executeTransformer
protected abstract void executeTransformer(@Nonnull Transformer transformer, @Nonnull @NonnullElements Collection<Item<Element>> items) throws StageProcessingException, TransformerConfigurationException Executes the XSLT transform on the given collection of Items.- Parameters:
transformer- The transform to be applied to each Item. Already has alltransformParametersset.items- the Items to which the transform should be applied- Throws:
StageProcessingException- thrown if there is a problem applying the transform to ItemsTransformerConfigurationException- thrown if there is a problem with the Transform itself
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.shared.component.AbstractIdentifiedInitializableComponent- Throws:
net.shibboleth.shared.component.ComponentInitializationException
-