Search in sources :

Example 1 with XSLTTransform

use of org.apache.cxf.jaxrs.ext.xml.XSLTTransform in project cxf by apache.

the class XSLTJaxbProvider method getAnnotationTemplates.

protected Templates getAnnotationTemplates(Annotation[] anns) {
    Templates t = null;
    XSLTTransform ann = AnnotationUtils.getAnnotation(anns, XSLTTransform.class);
    if (ann != null) {
        t = annotationTemplates.get(ann.value());
    }
    return t;
}
Also used : XSLTTransform(org.apache.cxf.jaxrs.ext.xml.XSLTTransform) Templates(javax.xml.transform.Templates)

Example 2 with XSLTTransform

use of org.apache.cxf.jaxrs.ext.xml.XSLTTransform in project cxf by apache.

the class XSLTJaxbProvider method getTemplatesFromAnnotation.

protected Templates getTemplatesFromAnnotation(Class<?> cls, Annotation[] anns, MediaType mt) {
    Templates t = null;
    XSLTTransform ann = getXsltTransformAnn(anns, mt);
    if (ann != null) {
        t = annotationTemplates.get(ann.value());
        if (t == null || refreshTemplates) {
            String path = ann.value();
            final String cp = "classpath:";
            if (!path.startsWith(cp)) {
                path = cp + path;
            }
            t = createTemplates(path);
            if (t == null) {
                createTemplates(ClassLoaderUtils.getResource(ann.value(), cls));
            }
            if (t != null) {
                annotationTemplates.put(ann.value(), t);
            }
        }
    }
    return t;
}
Also used : XSLTTransform(org.apache.cxf.jaxrs.ext.xml.XSLTTransform) Templates(javax.xml.transform.Templates)

Example 3 with XSLTTransform

use of org.apache.cxf.jaxrs.ext.xml.XSLTTransform in project tomee by apache.

the class XSLTJaxbProvider method getTemplatesFromAnnotation.

protected Templates getTemplatesFromAnnotation(Class<?> cls, Annotation[] anns, MediaType mt) {
    Templates t = null;
    XSLTTransform ann = getXsltTransformAnn(anns, mt);
    if (ann != null) {
        t = annotationTemplates.get(ann.value());
        if (t == null || refreshTemplates) {
            String path = ann.value();
            final String cp = "classpath:";
            if (!path.startsWith(cp)) {
                path = cp + path;
            }
            t = createTemplates(path);
            if (t == null) {
                createTemplates(ClassLoaderUtils.getResource(ann.value(), cls));
            }
            if (t != null) {
                annotationTemplates.put(ann.value(), t);
            }
        }
    }
    return t;
}
Also used : XSLTTransform(org.apache.cxf.jaxrs.ext.xml.XSLTTransform) Templates(javax.xml.transform.Templates)

Example 4 with XSLTTransform

use of org.apache.cxf.jaxrs.ext.xml.XSLTTransform in project tomee by apache.

the class XSLTJaxbProvider method getAnnotationTemplates.

protected Templates getAnnotationTemplates(Annotation[] anns) {
    Templates t = null;
    XSLTTransform ann = AnnotationUtils.getAnnotation(anns, XSLTTransform.class);
    if (ann != null) {
        t = annotationTemplates.get(ann.value());
    }
    return t;
}
Also used : XSLTTransform(org.apache.cxf.jaxrs.ext.xml.XSLTTransform) Templates(javax.xml.transform.Templates)

Aggregations

Templates (javax.xml.transform.Templates)4 XSLTTransform (org.apache.cxf.jaxrs.ext.xml.XSLTTransform)4