Package org.apache.tapestry.util.xml

Examples of org.apache.tapestry.util.xml.DocumentParseException


        }

        if (TAPESTRY_DTD_3_0_PUBLIC_ID.equals(publicId))
            return getDTDInputSource("Tapestry_3_0.dtd");

        throw new DocumentParseException(ParseMessages.unknownPublicId(getResource(), publicId),
                new LocationImpl(getResource()), null);
    }
View Full Code Here


            parser.parse(is, this);
        }
        catch (Exception ex)
        {
            throw new DocumentParseException(ex.getMessage(), getResource(), ex);
        }
    }
View Full Code Here

        while (i.hasNext())
        {
            String name = (String) i.next();

            if (!epi.isKnown(name))
                throw new DocumentParseException(
                    ScriptMessages.unexpectedAttributeInElement(name, _elementName),
                    getLocation(),
                    null);
        }

        // Now check that all required attributes have been specified.

        i = epi.getRequiredNames();
        while (i.hasNext())
        {
            String name = (String) i.next();

            if (!_attributes.containsKey(name))
                throw new DocumentParseException(
                    ScriptMessages.missingRequiredAttribute(name, _elementName),
                    getLocation(),
                    null);
        }
View Full Code Here

        {
            return _resolver.findClass(className);
        }
        catch (Exception ex)
        {
            throw new DocumentParseException(Tapestry.format(
                    "ScriptParser.unable-to-resolve-class",
                    className), parser.getLocation(), ex);
        }
    }
View Full Code Here

        {
            value = Ognl.getValue(expression, _ognlContext, this);
        }
        catch (OgnlException ex)
        {
            throw new DocumentParseException("Expression '" + expression + "' is not valid.", ex);
        }

        if (value == null)
            return false;

        if (value instanceof Boolean)
            return ((Boolean) value).booleanValue();

        if (value instanceof Number)
            return ((Number) value).longValue() != 0;

        if (value instanceof String)
            return ((String) value).length() > 0;

        throw new DocumentParseException("Expression '" + expression + "' evaluates to ("
                + value.getClass().getName() + ") " + value
                + ", which cannot be interpreted as a boolean.", null);
    }
View Full Code Here

            String name = a.getAttributeValue("name");
            String pattern = a.getTextTrim();

            if (HiveMind.isBlank(pattern))
                throw new DocumentParseException("Pattern is null in " + a, null);

            if (outputString == null)
                outputString = _response.getOutputString();

            matchRegexp(name, outputString, pattern);
View Full Code Here

            String name = a.getAttributeValue("name");
            String substring = a.getTextTrim();

            if (HiveMind.isBlank(substring))
                throw new DocumentParseException("Substring is null in " + a, null);

            if (outputString == null)
                outputString = _response.getOutputString();

            matchSubstring(name, outputString, substring);
View Full Code Here

            String name = a.getAttributeValue("name");
            String substring = a.getTextTrim();

            if (HiveMind.isBlank(substring))
                throw new DocumentParseException("Substring is null in " + a, null);

            if (outputString == null)
                outputString = _response.getOutputString();

            matchNoSubstring(name, outputString, substring);
View Full Code Here

        int subgroup = (value == null) ? 0 : Integer.parseInt(value);

        String pattern = element.getTextTrim();

        if (HiveMind.isBlank(pattern))
            throw new DocumentParseException("Pattern is null in " + element, null);

        PatternMatcherInput input = new PatternMatcherInput(outputString);

        PatternMatcher matcher = getMatcher();
        Pattern compiled = compile(pattern);
View Full Code Here

            parser.parse(is, this);
        }
        catch (Exception ex)
        {
            throw new DocumentParseException(ex.getMessage(), getResource(), ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.util.xml.DocumentParseException

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.