Package org.apache.tapestry5.ioc.internal.util

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


                                "You should not provide a type attribute in the template when defining an embedded component " +
                                "within the component class.",
                        embeddedId, embeddedType, modelType
                );

                throw new TapestryException(message, token, null);
            }

            embeddedType = modelType;
            embeddedComponentClassName = embeddedModel.getComponentClassName();
        }

        String componentClassName = embeddedComponentClassName;

        // This awkwardness is making me think that the page loader should resolve the component
        // type before invoking this method (we would then remove the componentType parameter).

        if (InternalUtils.isNonBlank(embeddedType))
        {
            // The type actually overrides the specified class name. The class name is defined
            // by the type of the field. In many scenarios, the field type is a common
            // interface,
            // and the type is used to determine the concrete class to instantiate.

            try
            {
                componentClassName = componentClassResolver.resolveComponentTypeToClassName(embeddedType);
            }
            catch (IllegalArgumentException ex)
            {
                throw new TapestryException(ex.getMessage(), token, ex);
            }
        }


        // OK, now we can record an action to get it instantiated.
View Full Code Here


    void setupRender()
    {
        FormSupport existing = environment.peek(FormSupport.class);

        if (existing != null)
            throw new TapestryException(messages.get("nesting-not-allowed"), existing, null);
    }
View Full Code Here

            }
            catch (Exception ex)
            {
                Location location = component == null ? null : component.getComponentResources().getLocation();

                throw new TapestryException(ex.getMessage(), location, ex);
            }
            finally
            {
                InternalUtils.close(ois);
            }
View Full Code Here

                                           embeddedId,
                                           instantiator.getModel().getComponentClassName(),
                                           container.getCompleteId(),
                                           InternalUtils.toMessage(ex));

            throw new TapestryException(message, location, ex);
        }
    }
View Full Code Here

                                publishedParameterName,
                                embeddedId,
                                instantiator.getModel().getComponentClassName(),
                                existingEmbeddedId);

                        throw new TapestryException(message, location, null);
                    }

                    publishedParameterToEmbeddedId.put(publishedParameterName, embeddedId);
                }

            }

            return embedded;
        }
        catch (Exception ex)
        {
            String message = String.format("Failure creating embedded component '%s' of %s: %s",
                                           embeddedId,
                                           instantiator.getModel().getComponentClassName(),
                                           InternalUtils.toMessage(ex));

            throw new TapestryException(message, location, ex);
        }
    }
View Full Code Here

                            "This may be a typo in the publishParameters attribute of the @Component annotation.",
                    parameterName,
                    instantiator.getModel().getComponentClassName(),
                    embeddedId);

            throw new TapestryException(message, embededdedComponentAssembler.getLocation(), null);
        }
        // The simple case, publishing a parameter of a subcomponent as if it were a parameter
        // of this component.

        return new ParameterBinder()
View Full Code Here

        String childId = child.getId();

        ComponentPageElement existing = children.get(childId);

        if (existing != null)
            throw new TapestryException(StructureMessages.duplicateChildComponent(this, childId), child,
                                        new TapestryException(StructureMessages.originalChildComponent(this, childId,
                                                                                                       existing.getLocation()),
                                                              existing, null));

        children.put(childId, child);
    }
View Full Code Here

        if (embeddedElement == null)
        {
            Set<String> ids = InternalUtils.keys(children);

            throw new TapestryException(StructureMessages.noSuchComponent(this, embeddedId, ids), this, null);
        }

        return embeddedElement;
    }
View Full Code Here

                    break;
                }
            }
        }

        if (result == null) throw new TapestryException(StructureMessages.unknownMixin(completeId, mixinClassName),
                                                        getLocation(), null);

        return result;
    }
View Full Code Here

                if (callback.isEventAborted()) return;
            }
        }
        catch (RuntimeException ex)
        {
            throw new TapestryException(ex.getMessage(), getLocation(), ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.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.