Package net.sourceforge.plantuml.code

Examples of net.sourceforge.plantuml.code.Transcoder


        request.setCharacterEncoding("UTF-8");
        String text = request.getParameter("text");
        String url = request.getParameter("url");
        String encoded = "";

        Transcoder transcoder = getTranscoder();
        // the URL form has been submitted
        if (url != null && !url.trim().isEmpty()) {
            // Catch the last part of the URL if necessary
            Matcher m1 = URL_PATTERN.matcher(url);
            if (m1.find()) {
                url = m1.group(1);
            }
            // Check it's a valid compressed text
            Matcher m2 = ENCODED_PATTERN.matcher(url);
            if (m2.find()) {
                    url = m2.group(0);
                    text = transcoder.decode(url);
            } else {
                System.out.println("PlantUML ERROR Not a valid compressed string : " + url);
            }
        }
        // the Text form has been submitted
        if (text != null && !text.trim().isEmpty()) {
            encoded = transcoder.encode(text);
        }

        request.setAttribute("decoded", text);
        request.setAttribute("encoded", encoded);
View Full Code Here


        try {
            text = URLDecoder.decode(source, "UTF-8");
        } catch (UnsupportedEncodingException uee) {
            text = "' invalid encoded string";
        }
        Transcoder transcoder = TranscoderUtil.getDefaultTranscoder();
        try {
            text = transcoder.decode(text);
        } catch (IOException ioe) {
            text = "' unable to decode string";
        }

        // encapsulate the UML syntax if necessary
View Full Code Here

TOP

Related Classes of net.sourceforge.plantuml.code.Transcoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.