All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.openhtmltopdf.util.LogMessageId Maven / Gradle / Ivy

Go to download

Open HTML to PDF is a CSS 2.1 renderer written in Java. This artifact contains the core rendering and layout code.

There is a newer version: 1.0.10
Show newest version
package com.openhtmltopdf.util;

public interface LogMessageId {

    Enum getEnum();
    String getWhere();
    String getMessageFormat();

    enum LogMessageId0Param implements LogMessageId {
        CSS_PARSE_MUST_PROVIDE_AT_LEAST_A_FONT_FAMILY_AND_SRC_IN_FONT_FACE_RULE(XRLog.CSS_PARSE, "Must provide at least a font-family and src in @font-face rule"),

        RENDER_BUG_FONT_DIDNT_CONTAIN_EXPECTED_CHARACTER(XRLog.RENDER, "BUG. Font didn't contain expected character."),
        RENDER_FONT_LIST_IS_EMPTY(XRLog.RENDER, "Font list is empty."),
        RENDER_FONT_IS_NULL(XRLog.RENDER, "Font is null."),

        LOAD_UNABLE_TO_DISABLE_XML_EXTERNAL_ENTITIES(XRLog.LOAD, "Unable to disable XML External Entities, which might put you at risk to XXE attacks"),
        LOAD_COULD_NOT_SET_VALIDATION_NAMESPACE_FEATURES_FOR_XML_PARSER(XRLog.LOAD, "Could not set validation/namespace features for XML parser, exception thrown."),
        LOAD_SAX_PARSER_BY_REQUEST_NOT_CHANGING_PARSER_FEATURES(XRLog.LOAD, "SAX Parser: by request, not changing any parser features."),
        LOAD_PAGE_DOES_NOT_EXIST_FOR_PDF_IN_IMG_TAG(XRLog.LOAD, "Page does not exist for pdf in img tag. Ignoring!"),
        LOAD_EMBEDDED_DATA_URI_MUST_BE_ENCODED_IN_BASE64(XRLog.LOAD, "Embedded data uris must be encoded in base 64."),
        LOAD_FALLING_BACK_ON_THE_DEFAULT_PARSER(XRLog.LOAD, "falling back on the default parser"),
        LOAD_BASE_URL_IS_NULL_TRYING_TO_CONFIGURE_ONE(XRLog.LOAD, "Base url is null, trying to configure one now."),

        RENDER_TRIED_TO_SET_NON_INVERTIBLE_CSS_TRANSFORM(XRLog.RENDER, "Tried to set a non-invertible CSS transform. Ignored."),
        RENDER_LINEAR_GRADIENT_IS_NOT_SUPPORTED(XRLog.RENDER, "linear-gradient(...) is not supported in this output device"),

        GENERAL_EXCEPTION_SHAPING_TEXT(XRLog.GENERAL, "Exception while shaping text"),
        GENERAL_EXCEPTION_DESHAPING_TEXT(XRLog.GENERAL, "Exception while deshaping text"),

        LAYOUT_ERROR_PARSING_SHAPE_COORDS(XRLog.LAYOUT, "Error while parsing shape coords"),
        LAYOUT_NO_SOURCE_PROVIDED_FOR_IMG_ELEMENT(XRLog.LAYOUT, "No source provided for img element."),
        LAYOUT_NO_CONTENT_LIMIT_FOUND(XRLog.LAYOUT, "No content limit found"),
        LAYOUT_BOX_HAS_NO_PAGE(XRLog.LAYOUT, "Box has no page"),

        CASCADE_IS_ABSOLUTE_CSS_UNKNOWN_GIVEN(XRLog.CASCADE, "Asked whether type was absolute, given CSS_UNKNOWN as the type. " +
                "Might be one of those funny values like background-position."),

        MATCH_TRYING_TO_SET_MORE_THAN_ONE_PSEUDO_ELEMENT(XRLog.MATCH, "Trying to set more than one pseudo-element"),

        GENERAL_IMPORT_FONT_FACE_RULES_HAS_NOT_BEEN_CALLED(XRLog.GENERAL, "importFontFaceRules has not been called for this pdf transcoder"),
        GENERAL_NO_OP_REPAINT_REQUESTED(XRLog.GENERAL, "No-op repaint requested"),
        GENERAL_PDF_ACCESSIBILITY_NO_ALT_ATTRIBUTE_PROVIDED_FOR_IMAGE(XRLog.GENERAL, "No alt attribute provided for image/replaced in PDF/UA document."),
        GENERAL_PDF_SPECIFIED_FONTS_DONT_CONTAIN_A_SPACE_CHARACTER(XRLog.GENERAL, "Specified fonts don't contain a space character!"),
        GENERAL_PDF_USING_FAST_MODE(XRLog.GENERAL, "Using fast-mode renderer. Prepare to fly."),
        GENERAL_PDF_ACCESSIBILITY_NO_DOCUMENT_TITLE_PROVIDED(XRLog.GENERAL, "No document title provided. Document will not be PDF/UA compliant."),
        GENERAL_PDF_USING_GET_REQUEST_FOR_FORM(XRLog.GENERAL, "Using GET request method for form. You probably meant to add a method=\"post\" attribute to your form"),
        GENERAL_PDF_ACROBAT_READER_DOES_NOT_SUPPORT_FORMS_WITH_FILE_INPUT(XRLog.GENERAL, "Acrobat Reader does not support forms with file input controls"),

        EXCEPTION_SVG_COULD_NOT_DRAW(XRLog.EXCEPTION, "Couldn't draw SVG."),
        EXCEPTION_SVG_COULD_NOT_READ_FONT(XRLog.EXCEPTION, "Couldn't read font"),
        EXCEPTION_MATHML_COULD_NOT_REGISTER_FONT(XRLog.EXCEPTION, "Could not register font correctly"),
        EXCEPTION_JAVA2D_COULD_NOT_LOAD_FONT(XRLog.EXCEPTION, "Couldn't load font. Please check that it is a valid truetype font."),
        EXCEPTION_PROBLEM_TRYING_TO_READ_INPUT_XHTML_FILE(XRLog.EXCEPTION, "Problem trying to read input XHTML file"),
        EXCEPTION_CANT_READ_XHTML_EMBEDDED_IMAGE(XRLog.EXCEPTION, "Can't read XHTML embedded image."),
        EXCEPTION_COULD_NOT_LOAD_FONT_METRICS(XRLog.EXCEPTION, "Couldn't load font metrics."),
        EXCEPTION_UNABLE_TO_PARSE_PAGE_OF_IMG_TAG_WITH_PDF(XRLog.EXCEPTION, "Unable to parse page of img tag with PDF!"),
        EXCEPTION_TRIED_TO_OPEN_A_PASSWORD_PROTECTED_DOCUMENT_AS_SRC_FOR_IMG(XRLog.EXCEPTION, "Tried to open a password protected document as src for an img!"),
        EXCEPTION_COULD_NOT_READ_PDF_AS_SRC_FOR_IMG(XRLog.EXCEPTION, "Could not read pdf passed as src for img element!"),
        EXCEPTION_COULD_NOT_PARSE_DEFAULT_STYLESHEET(XRLog.EXCEPTION, "Could not parse default stylesheet"),
        EXCEPTION_SELECTOR_BAD_SIBLING_AXIS(XRLog.EXCEPTION, "Bad sibling axis"),
        EXCEPTION_FONT_METRICS_NOT_AVAILABLE(XRLog.EXCEPTION, "Font metrics not available. Probably a bug.");

        private final String where;
        private final String messageFormat;

        LogMessageId0Param(String where, String messageFormat) {
            this.where = where;
            this.messageFormat = messageFormat;
        }

        @Override
        public Enum getEnum() {
            return this;
        }

        @Override
        public String getMessageFormat() {
            return messageFormat;
        }

        @Override
        public String getWhere() {
            return where;
        }

    }

    enum LogMessageId1Param implements LogMessageId {
        CSS_PARSE_REMOVING_STYLESHEET_URI_FROM_CACHE_BY_REQUEST(XRLog.CSS_PARSE, "Removing stylesheet '{}' from cache by request."),
        CSS_PARSE_REQUESTED_REMOVING_STYLESHEET_URI_NOT_IN_CACHE(XRLog.CSS_PARSE, "Requested removing stylesheet '{}', but it's not in cache."),

        XML_ENTITIES_SAX_FEATURE_NOT_SUPPORTED(XRLog.XML_ENTITIES, "SAX feature not supported on this XMLReader: {}"),
        XML_ENTITIES_SAX_FEATURE_NOT_RECOGNIZED(XRLog.XML_ENTITIES, "SAX feature not recognized on this XMLReader: {}. Feature may be properly named, but not recognized by this parser."),
        XML_ENTITIES_EXCEPTION_MESSAGE(XRLog.XML_ENTITIES, "{}"),
        XML_ENTITIES_COULD_NOT_OPEN_XML_CATALOG_FROM_URI(XRLog.XML_ENTITIES, "Could not open XML catalog from URI '{}'"),
        XML_ENTITIES_ENTITY_PUBLIC_NO_LOCAL_MAPPING(XRLog.XML_ENTITIES, "Entity public: {}, no local mapping. Returning empty entity to avoid pulling from network."),

        INIT_FONT_COULD_NOT_BE_LOADED(XRLog.INIT, "Font {} could not be loaded"),

        RENDER_OP_MUST_NOT_BE_USED_BY_FAST_RENDERER(XRLog.RENDER, "{} MUST not be used by the fast renderer. Please consider reporting this bug."),
        RENDER_UNKNOWN_PAINT(XRLog.RENDER, "Unknown paint: {}"),
        RENDER_USING_CSS_IMPLEMENTATION_FROM(XRLog.RENDER, "Using CSS implementation from: {}"),


        MATCH_TRYING_TO_APPEND_CONDITIONS_TO_PSEUDO_ELEMENT(XRLog.MATCH, "Trying to append conditions to pseudoElement {}"),
        MATCH_MATCHER_CREATED_WITH_SELECTOR(XRLog.MATCH, "Matcher created with {} selectors"),
        MATCH_MEDIA_IS(XRLog.MATCH, "media = {}"),

        LOAD_COULD_NOT_INSTANTIATE_CUSTOM_XML_READER(XRLog.LOAD, "Could not instantiate custom XMLReader class for XML parsing: {}. " +
                "Please check classpath. Use value 'default' in FS configuration if necessary. Will now try JDK default."),
        LOAD_UNABLE_TO_LOAD_CSS_FROM_URI(XRLog.LOAD, "Unable to load CSS from {}"),
        LOAD_PARSE_STYLESHEETS_TIME(XRLog.LOAD, "TIME: parse stylesheets {}ms"),
        LOAD_REQUESTING_STYLESHEET_AT_URI(XRLog.LOAD, "Requesting stylesheet: {}"),
        LOAD_UNRECOGNIZED_IMAGE_FORMAT_FOR_URI(XRLog.LOAD, "Unrecognized image format for: {}"),
        LOAD_URI_RESOLVER_REJECTED_RESOLVING_CSS_IMPORT_AT_URI(XRLog.LOAD, "URI resolver rejected resolving CSS import at ({})"),
        LOAD_URI_RESOLVER_REJECTED_RESOLVING_URI_AT_URI_IN_CSS_STYLESHEET(XRLog.LOAD, "URI resolver rejected resolving URI at ({}) in CSS stylehseet"),
        LOAD_PUTTING_KEY_IN_CACHE(XRLog.LOAD, "Putting key({}) in cache."),
        LOAD_EXCEPTION_MESSAGE(XRLog.LOAD, "{}"),
        LOAD_SAX_FEATURE_NOT_SUPPORTED(XRLog.LOAD, "SAX feature not supported on this XMLReader: {}"),
        LOAD_SAX_FEATURE_NOT_RECOGNIZED(XRLog.LOAD, "SAX feature not recognized on this XMLReader: {}. Feature may be properly named, but not recognized by this parser."),
        LOAD_COULD_NOT_LOAD_PREFERRED_XML(XRLog.LOAD, "Could not load preferred XML {}, using default which may not be secure."),
        LOAD_LOADED_DOCUMENT_TIME(XRLog.LOAD, "Loaded document in ~{}ms"),
        LOAD_SAX_XMLREADER_IN_USE(XRLog.LOAD, "SAX XMLReader in use (parser): {}"),
        LOAD_XMLREADER_CLASS_SPECIFIED_COULD_NOT_BE_FOUND(XRLog.LOAD,"The XMLReader class you specified as a configuration property " +
                "could not be found. Class.forName() failed on " +
                "{}. Please check classpath. Use value 'default' in " +
                "FS configuration if necessary. Will now try JDK default."),
        LOAD_ICON_REPLACED_IMAGE_REPAINT_REQUESTED(XRLog.LOAD, "Icon: replaced image {}, repaint requested"),
        LOAD_COULD_NOT_RESOLVE_RELATIVE_URI_BECAUSE_NO_BASE_URI_WAS_PROVIDED(XRLog.LOAD, "Couldn't resolve relative URI({}) because no base URI was provided."),
        LOAD_CLEARING_PENDING_ITEMS_FROM_LOAD_QUEUE(XRLog.LOAD, "By request, clearing pending items from load queue: {}"),
        LOAD_LOAD_IMMEDIATE_URI(XRLog.LOAD, "Load immediate: {}"),
        LOAD_IMAGE_CACHE_MISS_QUEUEING(XRLog.LOAD, "Image cache miss, URI not yet loaded, queueing: {}"),

        LAYOUT_FUNCTION_NOT_IMPLEMENTED(XRLog.LAYOUT, "{} function not implemented at this time"),
        LAYOUT_UNSUPPORTED_SHAPE(XRLog.LAYOUT, "Unsupported shape: '{}'"),
        LAYOUT_NO_MAP_NAMED(XRLog.LAYOUT, "No map named: '{}'"),
        LAYOUT_UNKNOWN_FIELD_TYPE(XRLog.LAYOUT, "Unknown field type: {}"),

        GENERAL_MESSAGE(XRLog.GENERAL, "{}"),
        GENERAL_INVALID_INTEGER_PASSED_IN_VIEWBOX_ATTRIBUTE_FOR_SVG(XRLog.GENERAL, "Invalid integer passed in viewBox attribute for SVG: {}"),
        GENERAL_QUEUEING_LOAD_FOR_IMAGE_URI(XRLog.GENERAL, "Queueing load for image uri {}"),
        GENERAL_INVALID_INTEGER_PASSED_AS_DIMENSION_FOR_SVG(XRLog.GENERAL, "Invalid integer passed as dimension for SVG: {}"),
        GENERAL_COULD_NOT_FIND_FONT_SPECIFIED_FOR_MATHML_OBJECT_IN_FONT_FACE_RULES(XRLog.GENERAL, "Could not find font ({}) specified for MathML object in font-face rules"),
        GENERAL_THREAD_REQUESTED_ITEM_BUT_QUEUE_IS_SHUTTING_DOWN(XRLog.GENERAL, "Thread {} requested item, but queue is shutting down; returning kill switch."),
        GENERAL_MUTABLE_IMAGE_URI_LOADED_REPAINT_REQUESTED(XRLog.GENERAL, "Mutable image {} loaded, repaint requested"),
        GENERAL_PDF_ACCESSIBILITY_NO_TITLE_TEXT_PROVIDED_FOR(XRLog.GENERAL, "PDF/UA - No title text provided for {}."),
        GENERAL_PDF_COULD_NOT_FIND_VALID_TARGET_FOR_BOOKMARK(XRLog.GENERAL, "Could not find valid target for bookmark. Bookmark href = {}"),
        GENERAL_PDF_COULD_NOT_FIND_VALID_TARGET_FOR_LINK(XRLog.GENERAL, "Could not find valid target for link. Link href = {}"),
        GENERAL_PDF_URI_IN_HREF_IS_NOT_A_VALID_URI(XRLog.GENERAL, "'{}' in href is not a valid URI, will be skipped"),
        GENERAL_PDF_FOUND_FORM_CONTROL_WITH_NO_ENCLOSING_FORM(XRLog.GENERAL, "Found form control ({}) with no enclosing form. Ignoring."),
        GENERAL_PDF_A_ELEMENT_DOES_NOT_HAVE_OPTION_CHILDREN(XRLog.GENERAL, "A <{}> element does not have 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy