/** * Specify the location of the template xslt file. * @param location * @return */ public XSLTTransformationFileSystem usingFilesystem(String location) { transformation.setTemplate(location); return transformation; }
/** * Create a new transformation for the given ref. */ public static XSLTTransformationOf of(String variable) { return new XSLTTransformationOf(variable); }
/** * Create a new transformation for the given ref. */ public static XSLTTransformationOf of(String variable) { return new XSLTTransformation(variable); }
.usingFilesystem(fullPath) .withDescription(description) .withExtension(extension) .withParameters(parameters)) .setUseSaxon(useSaxon); .of(of) .usingTemplate(fullPath) .withDescription(description) .withExtension(extension) .withParameters(parameters)) .setUseSaxon(useSaxon); return transformation; return transformation.withEffort(effort == null ? 0 : Integer.valueOf(effort)); .of(of) .usingTemplate(template, xmlFileAddonClassLoader) .withDescription(description) .withExtension(extension) .withParameters(parameters)) .setUseSaxon(useSaxon); .using(template, xmlFileAddonClassLoader) .withDescription(description) .withExtension(extension) .withParameters(parameters)) .setUseSaxon(useSaxon);
.of(of) .usingFilesystem(fullPath) .withDescription(description) .withExtension(extension) .withParameters(parameters); .usingFilesystem(fullPath) .withDescription(description) .withExtension(extension) .withParameters(parameters); .of(of) .using(template, xmlFileAddonClassLoader) .withDescription(description) .withExtension(extension) .withParameters(parameters); .using(template, xmlFileAddonClassLoader) .withDescription(description) .withExtension(extension) .withParameters(parameters);
/** * Set the payload to the fileModel of the given instance even though the variable is not directly of it's type. This is mainly to simplify the * creation of the rule, when the FileModel itself is not being iterated but just a model referencing it. * */ @Override public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { FileModel file = ((FileReferenceModel) payload).getFile(); perform(event, context, (XmlFileModel) file); } else { super.perform(event, context); } }
/** * Set the location of the source XSLT file. */ public static XSLTTransformationLocation using(String location) { return using(location, Thread.currentThread().getContextClassLoader()); }
private void setup() try (InputStream resourceAsStream = openInputStream())
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) setup(); GraphContext graphContext = event.getGraphContext(); GraphService<XsltTransformationModel> transformationService = new GraphService<>(
/** * Specify the relative location of the xslt file along with the classloader * @param location Location of the xslt file * @param classLoader ClassLoader in which the engine should load the location * @return */ public XSLTTransformationLocation using(String location, ClassLoader classLoader) { // classLoader instance needed to see the file passed in the location transformation.setContextClassLoader(classLoader); transformation.setTemplate(location); return transformation; }
/** * Set the payload to the fileModel of the given instance even though the variable is not directly of it's type. This is mainly to simplify the * creation of the rule, when the FileModel itself is not being iterated but just a model referencing it. * */ @Override public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { FileModel file = ((FileReferenceModel) payload).getFile(); perform(event, context, (XmlFileModel) file); } else { super.perform(event, context); } }
/** * Set the location of the source XSLT file to a absolute path on the filesystem */ public static XSLTTransformationFileSystem usingFilesystem(String location) { XSLTTransformation tansformation = new XSLTTransformation(); tansformation.template = location; return tansformation; }
/** * Create a new {@link XSLTTransformation} using the given location of the source XSLT file within the current * {@link Thread#getContextClassLoader()}. */ public static XSLTTransformationLocation using(String location) { return using(location, Thread.currentThread().getContextClassLoader()); }
private void setup() try (InputStream resourceAsStream = openInputStream(this.template)) InputStream inputStream = openInputStream(href); return new StreamSource(inputStream);
@Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) setup(); GraphContext graphContext = event.getGraphContext(); GraphService<XsltTransformationModel> transformationService = new GraphService<>(
/** * Set the text of this {@link Classification}. E.g: "Unparsable XML file." or "Source File" */ public XSLTTransformationLocation using(String location) { this.transformation.setTemplate(location); return this.transformation; } }
/** * Set the location of the source XSLT file and set it to use the provided {@link ClassLoader} for resource lookup. */ public static XSLTTransformationLocation using(String location, ClassLoader classLoader) { XSLTTransformation tansformation = new XSLTTransformation(); // classLoader instance needed to see the file passed in the location tansformation.contextClassLoader = classLoader; tansformation.template = location; return tansformation; }
/** * Create a new {@link XSLTTransformation} using the given location of the source XSLT file path on the file-system. */ public static XSLTTransformationFileSystem usingFilesystem(String location) { XSLTTransformation tansformation = new XSLTTransformation(); tansformation.template = location; return tansformation; }
XSLTTransformationOf(String variable) { this.transformation = new XSLTTransformation(variable); }
/** * Create a new {@link XSLTTransformation} using the given location of the source XSLT file within the given {@link ClassLoader}. */ public static XSLTTransformationLocation using(String location, ClassLoader classLoader) { XSLTTransformation tansformation = new XSLTTransformation(); /* * ClassLoader instance needed to see the file passed in the location */ tansformation.contextClassLoader = classLoader; tansformation.template = location; return tansformation; }