Package com.sun.facelets.tag

Examples of com.sun.facelets.tag.TagException


        tag.setProperties((AbstractCustomValidator) object);
    }

    public void apply(FaceletContext context, UIComponent parent) throws IOException, FacesException, ELException {
        if (parent == null || !(parent instanceof EditableValueHolder))
            throw new TagException(tag, "Parent not an instance of EditableValueHolder: " + parent);
        if (parent.getParent() == null) {
            EditableValueHolder editableValueHolder = (EditableValueHolder) parent;
            ValueExpression valueExpression = null;
            Validator validator = null;
            if (binding != null) {
                valueExpression = binding.getValueExpression(context, javax.faces.validator.Validator.class);
                validator = (Validator) valueExpression.getValue(context);
            }
            if (validator == null) {
                validator = createValidator(context);
                if (valueExpression != null)
                    valueExpression.setValue(context, validator);
            }
            if (validator == null)
                throw new TagException(tag, "No Validator was created");

            if (nextHandler instanceof CompositeFaceletHandler) {
                addParameters(context, (CompositeFaceletHandler) nextHandler);
            } else if (nextHandler instanceof MessageParameterTagHandler) {
                addParameter(context, (MessageParameterTagHandler) nextHandler);
View Full Code Here


     */
    public final void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, ELException {
        // make sure our parent is not null
        if (parent == null) {
            throw new TagException(this.tag, "Parent UIComponent was null");
        }

        // our id
        String id = ctx.generateUniqueId(this.tagId);

View Full Code Here

        UIComponent c;
        if (childCount == 1) {
            c = (UIComponent) facet.getChildren().get(0);
            parent.getFacets().put(name, c);
        } else {
            throw new TagException(this.tag, "Facet Tag can only have one child UIComponent");
        }
    }
View Full Code Here

                    }
                }
                src.addActionListener(listener);
            }
        } else {
            throw new TagException(this.tag,
                    "Parent is not of type ActionSource, type is: " + parent);
        }
    }
View Full Code Here

        } else if (isRemove(qname[0], qname[1])) {
            this.units.push(new RemoveUnit());
        } else if (this.tagLibrary.containsTagHandler(qname[0], qname[1])) {
            this.startUnit(new TagUnit(this.tagLibrary, qname[0], qname[1], t, this.nextTagId()));
        } else if (this.tagLibrary.containsNamespace(qname[0])) {
            throw new TagException(orig, "Tag Library supports namespace: "+qname[0]+", but no tag was defined for name: "+qname[1]);
        } else {
            TextUnit unit;
            if (this.currentUnit() instanceof TextUnit) {
                unit = (TextUnit) this.currentUnit();
            } else {
View Full Code Here

                            "Binding evaluated to null, and there wasn't a 'type' Attribute Specified");
                }
                evh.addValueChangeListener(listener);
            }
        } else {
            throw new TagException(this.tag,
                    "Parent is not of type EditableValueHolder, type is: "
                            + parent);
        }
    }
View Full Code Here

        Iterator itr = this.findNextByType(ChooseWhenHandler.class);
        while (itr.hasNext()) {
            whenList.add(itr.next());
        }
        if (whenList.isEmpty()) {
            throw new TagException(this.tag, "Choose Tag must have one or more When Tags");
        }
        this.when = (ChooseWhenHandler[]) whenList.toArray(new ChooseWhenHandler[whenList.size()]);
       
        itr = this.findNextByType(ChooseOtherwiseHandler.class);
        if (itr.hasNext()) {
View Full Code Here

                        this.instructionBuffer.clear();
                    }

                } catch (ELException e) {
                    if (this.tags.size() > 0) {
                        throw new TagException((Tag) this.tags.peek(), e
                                .getMessage());
                    } else {
                        throw new ELException(this.alias + ": "
                                + e.getMessage(), e.getCause());
                    }
                }
            }

            // KEEP THESE SEPARATE SO LOGIC DOESN'T GET FUBARED
        } else if (this.buffer.length() > 0) {
            String s = this.buffer.toString();
            if (s.trim().length() > 0) {
                if (child) {
                    s = trimRight(s);
                }
                if (s.length() > 0) {
                    try {
                        ELText txt = ELText.parse(s);
                        if (txt != null) {
                            if (txt.isLiteral()) {
                                this.children.add(new UILiteralTextHandler(txt
                                        .toString()));
                            } else {
                                this.children.add(new UITextHandler(this.alias,
                                        txt));
                            }
                        }
                    } catch (ELException e) {
                        if (this.tags.size() > 0) {
                            throw new TagException((Tag) this.tags.peek(), e
                                    .getMessage());
                        } else {
                            throw new ELException(this.alias + ": "
                                    + e.getMessage(), e.getCause());
                        }
View Full Code Here

                        this.instructionBuffer.clear();
                    }

                } catch (ELException e) {
                    if (this.tags.size() > 0) {
                        throw new TagException((Tag) this.tags.peek(), e
                                .getMessage());
                    } else {
                        throw new ELException(this.alias + ": "
                                + e.getMessage(), e.getCause());
                    }
                }
            }

            // KEEP THESE SEPARATE SO LOGIC DOESN'T GET FUBARED
        } else if (this.buffer.length() > 0) {
            String s = this.buffer.toString();
            if (s.trim().length() > 0) {
                if (child) {
                    s = trimRight(s);
                }
                if (s.length() > 0) {
                    try {
                        ELText txt = ELText.parse(s);
                        if (txt != null) {
                            if (txt.isLiteral()) {
                                this.children.add(new UILiteralTextHandler(txt
                                        .toString()));
                            } else {
                                this.children.add(new UITextHandler(this.alias,
                                        txt));
                            }
                        }
                    } catch (ELException e) {
                        if (this.tags.size() > 0) {
                            throw new TagException((Tag) this.tags.peek(), e
                                    .getMessage());
                        } else {
                            throw new ELException(this.alias + ": "
                                    + e.getMessage(), e.getCause());
                        }
View Full Code Here

        } else if (isRemove(qname[0], qname[1])) {
            this.units.push(new RemoveUnit());
        } else if (this.tagLibrary.containsTagHandler(qname[0], qname[1])) {
            this.startUnit(new TagUnit(this.tagLibrary, qname[0], qname[1], t, this.nextTagId()));
        } else if (this.tagLibrary.containsNamespace(qname[0])) {
            throw new TagException(orig, "Tag Library supports namespace: "+qname[0]+", but no tag was defined for name: "+qname[1]);
        } else {
            TextUnit unit;
            if (this.currentUnit() instanceof TextUnit) {
                unit = (TextUnit) this.currentUnit();
            } else {
View Full Code Here

TOP

Related Classes of com.sun.facelets.tag.TagException

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.