Package com.helger.xml.transform
Class XMLTransformerFactory
- java.lang.Object
-
- com.helger.xml.transform.XMLTransformerFactory
-
@Immutable public final class XMLTransformerFactory extends Object
A global factory for XML transformation objects.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TransformerFactorycreateTransformerFactory(ErrorListener aErrorListener, URIResolver aURIResolver)static TransformerFactorygetDefaultTransformerFactory()static voidmakeTransformerFactorySecure(TransformerFactory aFactory, String... aAllowedExternalSchemes)Set the secure processing feature to aTransformerFactory.static TemplatesnewTemplates(com.helger.commons.io.resource.IReadableResource aResource)Create a new XSLT Template for the passed resource.static TemplatesnewTemplates(Source aSource)Create a new XSLT Template for the passed resource.static TemplatesnewTemplates(TransformerFactory aFactory, com.helger.commons.io.resource.IReadableResource aResource)Create a new XSLT Template for the passed resource.static TemplatesnewTemplates(TransformerFactory aTransformerFactory, Source aSource)Create a new XSLT Template for the passed resource.static TransformernewTransformer()Create a new XSLT transformer for no specific resource.static TransformernewTransformer(com.helger.commons.io.resource.IReadableResource aResource)Create a new XSLT transformer for the passed resource.static TransformernewTransformer(Source aSource)Create a new XSLT transformer for the passed resource.static TransformernewTransformer(TransformerFactory aTransformerFactory)Create a new XSLT transformer for no specific resource.static TransformernewTransformer(TransformerFactory aTransformerFactory, com.helger.commons.io.resource.IReadableResource aResource)Create a new XSLT transformer for the passed resource.static TransformernewTransformer(TransformerFactory aTransformerFactory, Source aSource)Create a new XSLT transformer for the passed resource.
-
-
-
Method Detail
-
createTransformerFactory
@Nonnull public static TransformerFactory createTransformerFactory(@Nullable ErrorListener aErrorListener, @Nullable URIResolver aURIResolver)
-
makeTransformerFactorySecure
public static void makeTransformerFactorySecure(@Nonnull TransformerFactory aFactory, @Nullable String... aAllowedExternalSchemes)
Set the secure processing feature to aTransformerFactory. See https://docs.oracle.com/javase/tutorial/jaxp/properties/properties.html for details.- Parameters:
aFactory- The factory to secure. May not benull.aAllowedExternalSchemes- Optional external URL schemes that are allowed to be accessed (as in "file" or "http")- Since:
- 9.1.2
-
getDefaultTransformerFactory
@Nonnull public static TransformerFactory getDefaultTransformerFactory()
- Returns:
- The default transformer factory.
-
newTransformer
@Nullable public static Transformer newTransformer()
Create a new XSLT transformer for no specific resource. This uses the central not thread safe transformer factory.- Returns:
nullif something goes wrong
-
newTransformer
@Nullable public static Transformer newTransformer(@Nonnull TransformerFactory aTransformerFactory)
Create a new XSLT transformer for no specific resource.- Parameters:
aTransformerFactory- The transformer factory to be used. May not benull.- Returns:
nullif something goes wrong
-
newTransformer
@Nullable public static Transformer newTransformer(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
Create a new XSLT transformer for the passed resource. This uses the central not thread safe transformer factory.- Parameters:
aResource- The resource to be transformed. May not benull.- Returns:
nullif something goes wrong
-
newTransformer
@Nullable public static Transformer newTransformer(@Nonnull TransformerFactory aTransformerFactory, @Nonnull com.helger.commons.io.resource.IReadableResource aResource)
Create a new XSLT transformer for the passed resource.- Parameters:
aTransformerFactory- The transformer factory to be used. May not benull.aResource- The resource to be transformed. May not benull.- Returns:
nullif something goes wrong
-
newTransformer
@Nullable public static Transformer newTransformer(@Nonnull Source aSource)
Create a new XSLT transformer for the passed resource. This uses the central not thread safe transformer factory.- Parameters:
aSource- The resource to be transformed. May not benull.- Returns:
nullif something goes wrong
-
newTransformer
@Nullable public static Transformer newTransformer(@Nonnull TransformerFactory aTransformerFactory, @Nonnull Source aSource)
Create a new XSLT transformer for the passed resource.- Parameters:
aTransformerFactory- The transformer factory to be used. May not benull.aSource- The resource to be transformed. May not benull.- Returns:
nullif something goes wrong
-
newTemplates
@Nullable public static Templates newTemplates(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
Create a new XSLT Template for the passed resource. This uses the central not thread safe transformer factory.- Parameters:
aResource- The resource to be templated. May not benull.- Returns:
nullif something goes wrong
-
newTemplates
@Nullable public static Templates newTemplates(@Nonnull Source aSource)
Create a new XSLT Template for the passed resource. This uses the central not thread safe transformer factory.- Parameters:
aSource- The resource to be templated. May not benull.- Returns:
nullif something goes wrong
-
newTemplates
@Nullable public static Templates newTemplates(@Nonnull TransformerFactory aFactory, @Nonnull com.helger.commons.io.resource.IReadableResource aResource)
Create a new XSLT Template for the passed resource.- Parameters:
aFactory- The transformer factory to be used. May not benull.aResource- The resource to be templated. May not benull.- Returns:
nullif something goes wrong
-
newTemplates
@Nullable public static Templates newTemplates(@Nonnull TransformerFactory aTransformerFactory, @Nonnull Source aSource)
Create a new XSLT Template for the passed resource.- Parameters:
aTransformerFactory- The transformer factory to be used. May not benull.aSource- The resource to be templated. May not benull.- Returns:
nullif something goes wrong
-
-