Package org.apache.tapestry.ioc.internal.util

Examples of org.apache.tapestry.ioc.internal.util.TapestryException


            if (!_messages.contains(key))
            {
                String message = _messages.format("unknown-symbol", ch, format);

                throw new TapestryException(message, _resources.getLocation(), null);
            }

            builder.append(_messages.get(key));

            startx = nextx + 2;
View Full Code Here


        {
            _element.persistFieldChange(this, fieldName, newValue);
        }
        catch (Exception ex)
        {
            throw new TapestryException(StructureMessages.fieldPersistFailure(
                    getCompleteId(),
                    fieldName,
                    ex), getLocation(), ex);
        }
    }
View Full Code Here

            return _typeCoercer.coerce(boundValue, expectedType);
        }
        catch (Exception ex)
        {
            throw new TapestryException(StructureMessages.getParameterFailure(
                    parameterName,
                    getCompleteId(),
                    ex), b, ex);
        }
    }
View Full Code Here

            b.set(coerced);
        }
        catch (Exception ex)
        {
            throw new TapestryException(StructureMessages.writeParameterFailure(
                    parameterName,
                    getCompleteId(),
                    ex), b, ex);
        }
    }
View Full Code Here

            // Some parsers get in an unknown state when an error occurs, and are are not
            // subsequently useable.

            _reader = null;

            throw new TapestryException(ServicesMessages.templateParseError(templateResource, ex),
                    getCurrentLocation(), ex);
        }
        finally
        {
            reset();
View Full Code Here

    private void startParameter(Attributes attributes)
    {
        String parameterName = findSingleParameter("parameter", "name", attributes);

        if (InternalUtils.isBlank(parameterName))
            throw new TapestryException(ServicesMessages.parameterElementNameRequired(),
                    getCurrentLocation(), null);

        _tokens.add(new ParameterToken(parameterName, getCurrentLocation()));
        _endTagHandlerStack.push(_addEndElementToken);
    }
View Full Code Here

                continue;
            }

            // Only the name attribute is allowed.

            throw new TapestryException(ServicesMessages.undefinedTapestryAttribute(
                    elementName,
                    name,
                    attributeName), getCurrentLocation(), null);
        }
View Full Code Here

        boolean isComponent = (id != null || type != null);

        // If provided t:mixins but not t:id or t:type, then its not quite a component

        if (mixins != null && !isComponent)
            throw new TapestryException(ServicesMessages.mixinsInvalidWithoutIdOrType(elementName),
                    location, null);

        if (isComponent)
        {
            _tokens.add(new StartComponentToken(elementName, id, type, mixins, location));
View Full Code Here

            {
                // Expected
            }
            catch (Exception ex)
            {
                throw new TapestryException(ex.getMessage(), component, ex);
            }
            finally
            {
                TapestryInternalUtils.close(ois);
            }
View Full Code Here

                providers.add(new LiteralStringProvider(expression.substring(startx, expansionx)));

            int endx = expression.indexOf("}", expansionx);

            if (endx < 0)
                throw new TapestryException(ServicesMessages
                        .unclosedAttributeExpression(expression), location, null);

            String expansion = expression.substring(expansionx + 2, endx);

            final Binding binding = _bindingSource.newBinding(
                    "attribute expansion",
                    resources,
                    resources,
                    PROP_BINDING_PREFIX,
                    expansion,
                    location);

            final StringProvider provider = new StringProvider()
            {
                public String provideString()
                {
                    try
                    {
                        Object raw = binding.get();

                        return _typeCoercer.coerce(raw, String.class);
                    }
                    catch (Exception ex)
                    {
                        throw new TapestryException(ex.getMessage(), location, ex);
                    }
                }
            };

            providers.add(provider);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.internal.util.TapestryException

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.