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

        {
            if (_publicIds[i].equals(publicId))
            {

                if (!name.equals(_rootElement))
                    throw new DocumentParseException(
                        Tapestry.format(
                            "AbstractDocumentParser.incorrect-document-type",
                            _rootElement,
                            name),
                        location);

                return;
            }

        }

        throw new DocumentParseException(
            Tapestry.format("AbstractDocumentParser.unknown-public-id", location, publicId),
            location);
    }
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

    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

        String libraryId = getValidatedAttribute("id", LIBRARY_ID_PATTERN, "invalid-library-id");
        String path = getAttribute("specification-path");

        if (libraryId.equals(INamespace.FRAMEWORK_NAMESPACE)
                || libraryId.equals(INamespace.APPLICATION_NAMESPACE))
            throw new DocumentParseException(ParseMessages
                    .frameworkLibraryIdIsReserved(INamespace.FRAMEWORK_NAMESPACE), getLocation());

        ILibrarySpecification ls = (ILibrarySpecification) peekObject();

        ls.setLibrarySpecificationPath(libraryId, path);
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.