Package de.innovationgate.utils

Examples of de.innovationgate.utils.FormattingException


            }
            return text;
           
        }
        catch (ParseException e) {
           throw new FormattingException("Exception on RTF-Encoding", e);
        }
        catch (WGAPIException e) {
            throw new FormattingException("Exception on RTF-Encoding", e);
        }
  }
View Full Code Here


    public String format(Object obj) throws FormattingException {
        try {
            return URLEncoder.encode(String.valueOf(obj), _context.getwgacore().getCharacterEncoding());
        }
        catch (UnsupportedEncodingException e) {
            throw new FormattingException("Exception in URL encoder", e);
        }
    }
View Full Code Here

    public String format(Object obj) throws FormattingException {
        try {
            return WGUtils.toPlainText(String.valueOf(obj), "", false);
        }
        catch (IOException e) {
            throw new FormattingException(e);
        }
    }
View Full Code Here

        String result = de.innovationgate.utils.WGUtils.serializeCollection(results, (includeFormatting ? status.divider : ""), formatters);
       
        // Set formatting errors as warnings
        Iterator errors = formatters.getErrors().iterator();
        while (errors.hasNext()) {
            FormattingException e = (FormattingException) errors.next();
            addWarning("Formatting/Encoding error: " + WGUtils.getRootCause(e).getMessage());
        }

        // Append prefix and suffix and return, maybe trimmed
        String prefix = getPrefix();
View Full Code Here

                if (modDef != null) {
                    try {
                        modDef.testDependencies();
                    }
                    catch (ModuleDependencyException e) {
                        throw new FormattingException("WebTML encoder '" + encode + "' not available bc. of missing dependency: " + e.getMessage());
                    }
                    formatterClass = modDef.getImplementationClass();
                }
            }
           
            if (formatterClass != null) {
                try {
                    if (modDef != null) {
                        formatter = (ObjectFormatter) getModuleRegistry().instantiate(modDef);
                    }
                    else {
                        formatter = (ObjectFormatter) formatterClass.newInstance();
                    }
                }
                catch (Exception e) {
                    throw new FormattingException("The encoder class " + formatterClass.getName() + " is not instantiable", e);
                }
            }
            else {
                throw new FormattingException("Unknown encoder " + encode);
        }
        }

        if (formatter instanceof TMLContextAwareFormatter) {
            ((TMLContextAwareFormatter) formatter).setContext(context);
View Full Code Here

                restriction.setHostIP(new IPv4Address(str));
                return restriction;
            }
        }
        catch (Exception e) {
            throw new FormattingException("Exception parsing restriction string", e);
        }
       
    }
View Full Code Here

TOP

Related Classes of de.innovationgate.utils.FormattingException

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.