Package com.sun.facelets.tag

Examples of com.sun.facelets.tag.TagException


   * javax.faces.component.UIComponent)
   */
  public void apply(FaceletContext ctx, UIComponent parent)
      throws IOException, FacesException, FaceletException, ELException {
    if (parent == null || !(parent instanceof EditableValueHolder)) {
      throw new TagException(this.tag,
          "Parent not an instance of EditableValueHolder: " + parent);
    }
    if (null == parent.getParent()) {
      // New created component, add validator.
      FacesContext facesContext = FacesContext.getCurrentInstance();
View Full Code Here


    public JbpmActionListenerHandler(final TagConfig config) {
        super(config);
        typeTagAttribute = getAttribute("type");
        listenerTagAttribute = getAttribute("listener");
        if ((typeTagAttribute == null) == (listenerTagAttribute == null)) {
            throw new TagException(tag, "Exactly one of the \"type\" or \"listener\" attributes must be given");
        }
    }
View Full Code Here

   * javax.faces.component.UIComponent)
   */
  public void apply(FaceletContext ctx, UIComponent parent)
      throws IOException, FacesException, FaceletException, ELException {
    if (parent == null || !(parent instanceof EditableValueHolder)) {
      throw new TagException(this.tag,
          "Parent not an instance of EditableValueHolder: " + parent);
    }
    if (null == parent.getParent()) {
      // New created component, add validator.
      FacesContext facesContext = FacesContext.getCurrentInstance();
View Full Code Here

        nameAttribute = getAttribute("name");
    }

    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException {
        if (! (parent instanceof ActionSource)) {
            throw new TagException(tag, "Parent component is not an ActionSource");
        }
        if (ComponentSupport.isNew(parent)) {
            ((ActionSource) parent).addActionListener(
                new JbpmActionListenerWrapper(
                    getListener(ctx),
View Full Code Here

        if (file == null || file.length() == 0) {
            return;
        }
        final ProcessDefinition processDefinition = (ProcessDefinition) processExpression.getValue(ctx);
        if (processDefinition == null) {
            throw new TagException(tag, "Value for process attribute is null");
        }
        final FileDefinition fileDefinition = processDefinition.getFileDefinition();
        if (fileDefinition == null) {
            throw new TagException(tag, "Process has a null fileDefinition property");
        }
        if (! fileDefinition.hasFile(file)) {
            throw new TagException(tag, "Process does not contain file '" + file + "'");
        }
        VariableMapper orig = ctx.getVariableMapper();
        final VariableMapperWrapper newVarMapper = new VariableMapperWrapper(orig);
        ctx.setVariableMapper(newVarMapper);
        try {
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");
        }
       
        // possible facet scoped
        String facetName = this.getFacetName(ctx, parent);

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

     *      javax.faces.component.UIComponent)
     */
    public final void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, FaceletException, ELException {
        if (parent == null || !(parent instanceof ValueHolder)) {
            throw new TagException(this.tag,
                    "Parent not an instance of ValueHolder: " + parent);
        }

        // only process if it's been created
        if (parent.getParent() == null) {
            // cast to a ValueHolder
            ValueHolder vh = (ValueHolder) parent;
            ValueExpression ve = null;
            Converter c = null;
            if (this.binding != null) {
                ve = this.binding.getValueExpression(ctx, Converter.class);
                c = (Converter) ve.getValue(ctx);
            }
            if (c == null) {
                c = this.createConverter(ctx);
                if (ve != null) {
                    ve.setValue(ctx, c);
                }
            }
            if (c == null) {
                throw new TagException(this.tag, "No Converter was created");
            }
            this.setAttributes(ctx, c);
            vh.setConverter(c);
            Object lv = vh.getLocalValue();
            FacesContext faces = ctx.getFacesContext();
View Full Code Here

     *            FaceletContext to use
     * @return Converter instance, cannot be null
     */
    protected Converter createConverter(FaceletContext ctx) {
        if (this.converterId == null) {
            throw new TagException(
                    this.tag,
                    "Default behavior invoked of requiring a converter-id passed in the constructor, must override ConvertHandler(ConverterConfig)");
        }
        return ctx.getFacesContext().getApplication().createConverter(this.converterId);
    }
View Full Code Here

     */
    public final void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, FaceletException, ELException {

        if (parent == null || !(parent instanceof EditableValueHolder)) {
            throw new TagException(this.tag,
                    "Parent not an instance of EditableValueHolder: " + parent);
        }

        // only process if it's been created
        if (parent.getParent() == null) {
            // cast to a ValueHolder
            EditableValueHolder evh = (EditableValueHolder) parent;
            ValueExpression ve = null;
            Validator v = null;
            if (this.binding != null) {
                ve = this.binding.getValueExpression(ctx, Validator.class);
                v = (Validator) ve.getValue(ctx);
            }
            if (v == null) {
                v = this.createValidator(ctx);
                if (ve != null) {
                    ve.setValue(ctx, v);
                }
            }
            if (v == null) {
                throw new TagException(this.tag, "No Validator was created");
            }
            this.setAttributes(ctx, v);
            evh.addValidator(v);
        }
    }
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.