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

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


                    finalClassName = _componentClassResolver
                            .resolveComponentTypeToClassName(componentType);
                }
                catch (IllegalArgumentException ex)
                {
                    throw new TapestryException(ex.getMessage(), location, ex);
                }
            }

            Instantiator instantiator = _componentInstantiatorSource
                    .findInstantiator(finalClassName);

            // This is actually a good place to check for recursive templates, here where we've
            // resolved
            // the component type to a fully qualified class name.

            checkForRecursion(finalClassName, container, location);

            // The container for any components is the loading component, regardless of
            // how the component elements are nested within the loading component's
            // template.

            ComponentPageElement result = container.newChild(id, elementName, instantiator, location);

            page.addLifecycleListener(result);

            addMixins(result, instantiator);

            return result;
        }
        catch (RuntimeException ex)
        {
            throw new TapestryException(ex.getMessage(), location, ex);
        }
    }
View Full Code Here


        ComponentResources resources = container.getComponentResources();

        while (resources != null)
        {
            if (resources.getComponentModel().getComponentClassName().equals(componentClassName))
                throw new TapestryException(ServicesMessages.componentRecursion(componentClassName), location, null);

            resources = resources.getContainerResources();
        }
    }
View Full Code Here

    {
        Location l = mockLocation();

        replay();

        Throwable t = new TapestryException("Message", l, null);

        ExceptionAnalysis ea = _analyzer.analyze(t);

        assertEquals(ea.getExceptionInfos().size(), 1);
View Full Code Here

        Location l = mockLocation();

        replay();

        Throwable inner = new RuntimeException("Inner");
        Throwable middle = new TapestryException("Middle", l, inner);
        Throwable outer = new RuntimeException("Outer: Middle", middle);

        ExceptionAnalysis ea = _analyzer.analyze(outer);

        assertEquals(ea.getExceptionInfos().size(), 3);
View Full Code Here

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

            return _pageResources.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

    /**
     * @throws TapestryException always
     */
    public void set(Object value)
    {
        throw new TapestryException(BindingsMessages.bindingIsReadOnly(this), this, null);
    }
View Full Code Here

                              ComponentResources component, String expression, Location location)
    {
        Object fieldAsObject = component.getComponent();

        if (!Field.class.isInstance(fieldAsObject))
            throw new TapestryException(BindingsMessages.validateBindingForFieldsOnly(component),
                                        location, null);

        Field field = (Field) fieldAsObject;

        // The expression is a validator specification, such as "required,minLength=5".
View Full Code Here

public class ExceptionUtilsTest extends Assert
{
    @Test
    public void find_cause_with_match()
    {
        TapestryException inner = new TapestryException("foo", null);

        RuntimeException outer = new RuntimeException(inner);

        assertSame(ExceptionUtils.findCause(outer, TapestryException.class), inner);
    }
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.