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

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


        Instantiator mixinInstantiator = instantiatorSource.getInstantiator(className);

        String mixinId = InternalUtils.lastTerm(className);

        if (mixinIdToInstantiator.containsKey(mixinId))
            throw new TapestryException(PageloadMessages.uniqueMixinRequired(mixinId), location, null);

        mixinIdToInstantiator.put(mixinId, mixinInstantiator);
        mixinsIdToOrderConstraints.put(mixinId, order);
    }
View Full Code Here


            return createParameterBinderForComponent(qualifiedParameterName, parameterName);
        }

        if (!mixinIdToInstantiator.containsKey(mixinId))
        {
            throw new TapestryException(
                    String.format("Mixin id for parameter '%s' not found. Attached mixins: %s.", qualifiedParameterName,
                            InternalUtils.joinSorted(mixinIdToInstantiator.keySet())), location,
                    null);
        }
View Full Code Here

            return new ParameterBinderImpl(mixinId, parameterName, null);
        }

        // Pretty sure this was not caught as an error in 5.2.

        throw new TapestryException(String.format("Binding parameter %s as an informal parameter does not make sense, as %s does not support informal parameters.",
                qualifiedParameterName, model.getComponentClassName()), location, null);
    }
View Full Code Here

                try
                {
                    return createConduit(resources, fieldTypeName, fieldName, possibleNames);
                } catch (Exception ex)
                {
                    throw new TapestryException(String.format(
                            "Failure binding parameter field '%s' of mixin %s (type %s): %s", fieldName, resources
                            .getCompleteId(), resources.getComponentModel().getComponentClassName(),
                            InternalUtils.toMessage(ex)), ex);
                }
            }
View Full Code Here

    private FieldConduit<Object> createConduit(final ComponentResources resources, final String fieldTypeName,
                                               final String fieldName, final String[] possibleNames)
    {
        if (!resources.isMixin())
            throw new TapestryException(TransformMessages.bindParameterOnlyOnMixin(fieldName, resources), null);

        InternalComponentResources containerResources = (InternalComponentResources) resources.getContainerResources();

        // Evaluate this early so that we get a fast fail.
View Full Code Here

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

            try
            {
                resources.getEmbeddedComponent(componentId);
            } catch (UnknownValueException ex)
            {
                throw new TapestryException(String.format("Method %s references component id '%s' which does not exist.",
                        methodIdentifier, componentId), resources.getLocation(), ex);
            }
        }
View Full Code Here

            renderingValue.set(false);

            Element current = writer.getElement();

            if (current != expectedElementAtCompletion)
                throw new TapestryException(StructureMessages.unbalancedElements(completeId), getLocation(), null);

            invoke(false, POST_RENDER_CLEANUP);

            queue.endComponent();
        }
View Full Code Here

        }

        // Sanity check: since an extension point defines its own default, it's going to be hard to
        // not find an override, somewhere, for it.

        throw new TapestryException(PageloadMessages.couldNotFindOverride(extensionPointId),
                extensionPointToken.getLocation(), null);
    }
View Full Code Here

        {
            String modelType = embeddedModel.getComponentType();

            if (InternalUtils.isNonBlank(modelType) && embeddedType != null)
            {
                throw new TapestryException(
                        PageloadMessages.redundantEmbeddedComponentTypes(embeddedId, embeddedType, modelType), 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 (RuntimeException ex)
            {
                throw new TapestryException(ex.getMessage(), token, ex);
            }
        }

        // OK, now we can record an action to get it instantiated.
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.