Package org.apache.tapestry.util.xml

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


                LOG.debug("Parsing " + location);

            URL url = location.getResourceURL();

            if (url == null)
                throw new DocumentParseException(
                    Tapestry.format("AbstractDocumentParser.missing-resource", location),
                    location);

            InputSource source = new InputSource(url.toExternalForm());

            digester.setResourceLocation(location);

            Object result = digester.parse(source);

            if (LOG.isDebugEnabled())
                LOG.debug("Result: " + result);

            return result;
        }
        catch (SAXParseException ex)
        {
            throw new DocumentParseException(ex);
        }
        catch (DocumentParseException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new DocumentParseException(
                Tapestry.format(
                    "SpecificationParser.error-reading-resource",
                    location,
                    ex.getMessage()),
                location,
View Full Code Here


        public Object convert(String value) throws DocumentParseException
        {
            Object result = CONVERSION_MAP.get(value.toLowerCase());

            if (result == null || !(result instanceof Boolean))
                throw new DocumentParseException(
                    Tapestry.format("SpecificationParser.fail-convert-boolean", value));

            return result;
        }
View Full Code Here

            {
                return new Integer(value);
            }
            catch (NumberFormatException ex)
            {
                throw new DocumentParseException(
                    Tapestry.format("SpecificationParser.fail-convert-int", value),
                    ex);
            }
        }
View Full Code Here

            {
                return new Long(value);
            }
            catch (NumberFormatException ex)
            {
                throw new DocumentParseException(
                    Tapestry.format("SpecificationParser.fail-convert-long", value),
                    ex);
            }
        }
View Full Code Here

            {
                return new Double(value);
            }
            catch (NumberFormatException ex)
            {
                throw new DocumentParseException(
                    Tapestry.format("SpecificationParser.fail-convert-double", value),
                    ex);
            }
        }
View Full Code Here

            String type = getValue(attributes, "type");

            _converter = (IConverter) CONVERSION_MAP.get(type);

            if (_converter == null)
                throw new DocumentParseException(
                    Tapestry.format("SpecificationParser.unknown-static-value-type", type),
                    getResourceLocation());

        }
View Full Code Here

        {
            if (StringUtils.isEmpty(text))
                return;

            if (_value != null)
                throw new DocumentParseException(
                    Tapestry.format("SpecificationParser.no-attribute-and-body", "value", name),
                    getResourceLocation());

            _value = text.trim();
        }
View Full Code Here

        }

        public void end(String namespace, String name) throws Exception
        {
            if (_value == null)
                throw new DocumentParseException(
                    Tapestry.format(
                        "SpecificationParser.required-extended-attribute",
                        name,
                        "value"),
                    getResourceLocation());
View Full Code Here

    private void copyBindings(String sourceComponentId, IComponentSpecification cs,
            IContainedComponent target)
    {
        IContainedComponent source = cs.getComponent(sourceComponentId);
        if (source == null)
            throw new DocumentParseException(ParseMessages.unableToCopy(sourceComponentId),
                    getLocation());

        Iterator i = source.getBindingNames().iterator();
        while (i.hasNext())
        {
View Full Code Here

        boolean hasCopyOf = HiveMind.isNonBlank(copyOf);

        if (hasCopyOf)
        {
            if (HiveMind.isNonBlank(type))
                throw new DocumentParseException(ParseMessages.bothTypeAndCopyOf(id), getLocation());
        }
        else
        {
            if (HiveMind.isBlank(type))
                throw new DocumentParseException(ParseMessages.missingTypeOrCopyOf(id),
                        getLocation());
        }

        IContainedComponent cc = _factory.createContainedComponent();
        cc.setType(type);
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.