Search in sources :

Example 16 with JSPResourceEncodingDetector

use of org.eclipse.jst.jsp.core.internal.contenttype.JSPResourceEncodingDetector in project webtools.sourceediting by eclipse.

the class JSPEncodingTests method testUTF16le.

public void testUTF16le() throws IOException {
    String filename = fileLocation + "utf16le.jsp";
    doTestFileStream(filename, "UTF-16LE", new JSPResourceEncodingDetector());
}
Also used : JSPResourceEncodingDetector(org.eclipse.jst.jsp.core.internal.contenttype.JSPResourceEncodingDetector)

Example 17 with JSPResourceEncodingDetector

use of org.eclipse.jst.jsp.core.internal.contenttype.JSPResourceEncodingDetector in project webtools.sourceediting by eclipse.

the class ContentDescriberForJSPedCSS method handleCalculations.

private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
    // handle standard ones first, to be sure detector processes
    handleStandardCalculations(description, detector);
    // check, for now.
    if (detector instanceof JSPResourceEncodingDetector) {
        JSPResourceEncodingDetector jspDetector = (JSPResourceEncodingDetector) detector;
        String language = jspDetector.getLanguage();
        if (language != null && language.length() > 0) {
            description.setProperty(IContentDescriptionForJSP.LANGUAGE_ATTRIBUTE, language);
        }
        String contentTypeAttribute = jspDetector.getContentType();
        if (contentTypeAttribute != null && contentTypeAttribute.length() > 0) {
            description.setProperty(IContentDescriptionForJSP.CONTENT_TYPE_ATTRIBUTE, contentTypeAttribute);
        }
    }
}
Also used : JSPResourceEncodingDetector(org.eclipse.jst.jsp.core.internal.contenttype.JSPResourceEncodingDetector)

Aggregations

JSPResourceEncodingDetector (org.eclipse.jst.jsp.core.internal.contenttype.JSPResourceEncodingDetector)17 EncodingMemento (org.eclipse.wst.sse.core.internal.encoding.EncodingMemento)2 BufferedInputStream (java.io.BufferedInputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1