class JavaPropertiesResource extends ResourceFilter {

    static String escapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc) throws ResourceFilterException {
        // Quick check - if there are no apostrophes, skip this operation.
        if (inputStr.indexOf("'") < 0) {
            return inputStr;
        }

        MessagePattern msgPat = new MessagePattern(ApostropheMode.DOUBLE_OPTIONAL);

        try {
            msgPat.parse(inputStr);

            if (msgPatEsc == MessagePatternEscape.AUTO && !hasArgs(msgPat)) {
                // In AUTO mode, a strings is not handled as message format pattern
                // when no arguments are found.

                // TODO: See the comment in unescapeMessagePattern()

                return inputStr;
            }
        } catch (Exception e) {
            // This input string cannot be parsed as MessageFormat pattern.
            if (msgPatEsc == MessagePatternEscape.ALL) {
                throw new ResourceFilterException("Illegal message pattern string: " + inputStr);
            }
            // If msgPatEsc is not MessagePatternEscape.ALL, input string does
            // not need to be a valid message pattern. In this case, just return
            // the input as is.
            return inputStr;
        }

        return msgPat.autoQuoteApostropheDeep();
    }

    public  JavaPropertiesResource(Encoding enc, MessagePatternEscape msgPatEsc);
    public  JavaPropertiesResource();

}