Package org.apache.tapestry.util.xml

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


        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


    private void expectElement(String elementName)
    {
        if (_elementName.equals(elementName))
            return;

        throw new DocumentParseException(ParseMessages.incorrectDocumentType(
                _elementName,
                elementName), getLocation(), null);

    }
View Full Code Here

        boolean asAttribute = HiveMind.isNonBlank(attributeValue);
        boolean asContent = HiveMind.isNonBlank(contentValue);

        if (asAttribute && asContent)
        {
            throw new DocumentParseException(ParseMessages.noAttributeAndBody(
                    attributeName,
                    _elementName), getLocation(), null);
        }

        if (required && !(asAttribute || asContent))
        {
            throw new DocumentParseException(ParseMessages.requiredExtendedAttribute(
                    _elementName,
                    attributeName), getLocation(), null);
        }

        if (asAttribute)
View Full Code Here

                _parser = _parserFactory.newSAXParser();

            URL resourceURL = resource.getResourceURL();

            if (resourceURL == null)
                throw new DocumentParseException(ParseMessages.missingResource(resource), resource);

            InputStream rawStream = resourceURL.openStream();
            stream = new BufferedInputStream(rawStream);

            _parser.parse(stream, this, resourceURL.toExternalForm());

            stream.close();
            stream = null;

            success = true;
        }
        catch (SAXParseException ex)
        {
            _parser = null;

            Location location = new LocationImpl(resource, ex.getLineNumber(), ex.getColumnNumber());

            throw new DocumentParseException(ParseMessages.errorReadingResource(resource, ex),
                    location, ex);
        }
        catch (Exception ex)
        {
            _parser = null;

            throw new DocumentParseException(ParseMessages.errorReadingResource(resource, ex),
                    resource, ex);
        }
        finally
        {
            if (!success)
View Full Code Here

        }

        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

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

    private void copyBindings(String sourceComponentId, IComponentSpecification cs,
            IContainedComponent target)
    {try { __CLOVER_225_0.M[2772]++;
        __CLOVER_225_0.S[11295]++;IContainedComponent source = cs.getComponent(sourceComponentId);
        __CLOVER_225_0.S[11296]++;if ((((source == null) && (++__CLOVER_225_0.CT[1961] != 0)) || (++__CLOVER_225_0.CF[1961] == 0))){
            __CLOVER_225_0.S[11297]++;throw new DocumentParseException(ParseMessages.unableToCopy(sourceComponentId),
                    getLocation(), null);}

        __CLOVER_225_0.S[11298]++;Iterator i = source.getBindingNames().iterator();
        __CLOVER_225_0.S[11299]++;while ((((i.hasNext()) && (++__CLOVER_225_0.CT[1962] != 0)) || (++__CLOVER_225_0.CF[1962] == 0))){
        {
View Full Code Here

        __CLOVER_225_0.S[11405]++;boolean hasCopyOf = Tapestry.isNonBlank(copyOf);

        __CLOVER_225_0.S[11406]++;if ((((hasCopyOf) && (++__CLOVER_225_0.CT[1964] != 0)) || (++__CLOVER_225_0.CF[1964] == 0))){
        {
            __CLOVER_225_0.S[11407]++;if ((((Tapestry.isNonBlank(type)) && (++__CLOVER_225_0.CT[1965] != 0)) || (++__CLOVER_225_0.CF[1965] == 0))){
                __CLOVER_225_0.S[11408]++;throw new DocumentParseException(ParseMessages.bothTypeAndCopyOf(id),
                        getLocation(), null);}
        }}
        else{
        {
            __CLOVER_225_0.S[11409]++;if ((((Tapestry.isBlank(type)) && (++__CLOVER_225_0.CT[1966] != 0)) || (++__CLOVER_225_0.CF[1966] == 0))){
                __CLOVER_225_0.S[11410]++;throw new DocumentParseException(ParseMessages.missingTypeOrCopyOf(id),
                        getLocation(), null);}
        }}

        __CLOVER_225_0.S[11411]++;IContainedComponent cc = _factory.createContainedComponent();
        __CLOVER_225_0.S[11412]++;cc.setType(type);
View Full Code Here

    {try { __CLOVER_225_0.M[2796]++;
        __CLOVER_225_0.S[11450]++;String libraryId = getValidatedAttribute("id", LIBRARY_ID_PATTERN, "invalid-library-id");
        __CLOVER_225_0.S[11451]++;String path = getAttribute("specification-path");

        __CLOVER_225_0.S[11452]++;if ((((libraryId.equals(INamespace.FRAMEWORK_NAMESPACE)) && (++__CLOVER_225_0.CT[1968] != 0)) || (++__CLOVER_225_0.CF[1968] == 0))){
            __CLOVER_225_0.S[11453]++;throw new DocumentParseException(ParseMessages
                    .frameworkLibraryIdIsReserved(INamespace.FRAMEWORK_NAMESPACE), getLocation(),
                    null);}

        __CLOVER_225_0.S[11454]++;ILibrarySpecification ls = (ILibrarySpecification) peekObject();
View Full Code Here

    private void expectElement(String elementName)
    {try { __CLOVER_225_0.M[2810]++;
        __CLOVER_225_0.S[11539]++;if ((((_elementName.equals(elementName)) && (++__CLOVER_225_0.CT[1972] != 0)) || (++__CLOVER_225_0.CF[1972] == 0))){
            __CLOVER_225_0.S[11540]++;return;}

        __CLOVER_225_0.S[11541]++;throw new DocumentParseException(ParseMessages.incorrectDocumentType(
                _elementName,
                elementName), getLocation(), null);

    } finally { }}
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.