private final MetadataTarget getMetadataTarget() { String key = this.type.getName(); MetadataTarget meta = (MetadataTarget) metadata.get(key); if (meta == null) { try { meta = new MetadataTargetImpl(type); } catch (IntrospectionException e) { throw new TagException(this.tag, "Error Creating TargetMetadata", e); } metadata.put(key, meta); } return meta; }
/** * Utility method for fetching a required TagAttribute * * @param localName * name of the attribute * @return TagAttribute if found, otherwise error * @throws TagException * if the attribute was not found */ protected final TagAttribute getRequiredAttribute(String localName) throws TagException { TagAttribute attr = this.getAttribute(localName); if (attr == null) { throw new TagException(this.tag, "Attribute '" + localName + "' is required"); } return attr; }
public ChooseHandler(TagConfig config) { super(config); List whenList = new ArrayList(); 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()) { this.otherwise = (ChooseOtherwiseHandler) itr.next(); } else { this.otherwise = null; } }
/** * Template method for creating a Validator instance * * @param ctx * FaceletContext to use * @return a new Validator instance */ protected Validator createValidator(FaceletContext ctx) { if (this.validatorId == null) { throw new TagException( this.tag, "Default behavior invoked of requiring a validator-id passed in the constructor, must override ValidateHandler(ValidatorConfig)"); } return ctx.getFacesContext().getApplication().createValidator( this.validatorId); }
/** * Create a Converter instance * * @param ctx * 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); }
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"); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (parent == null) { throw new TagException(this.tag, "Parent UIComponent was null"); } parent.getAttributes().put(KEY, this.name.getValue(ctx)); try { this.nextHandler.apply(ctx, parent); } finally { parent.getAttributes().remove(KEY); } } }
throw new TagException(tag, "Value for process attribute is null"); throw new TagException(tag, "Process has a null fileDefinition property"); throw new TagException(tag, "Process does not contain file '" + file + "'");
throw new TagException(tag, "Parent is not of type ValueHolder, type is: " + parent);
throw new TagException(this.tag, "Parent not an instance of EditableValueHolder: " + parent); throw new TagException(this.tag, "No Validator was created");
throw new TagException((Tag) this.tags.peek(), e .getMessage()); } else { throw new TagException((Tag) this.tags.peek(), e .getMessage()); } else {
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (parent instanceof ActionSource) { if (ComponentSupport.isNew(parent)) { ActionSource as = (ActionSource) parent; ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, ActionListener.class); } ActionListener listener = new LazyActionListener(this.listenerType, b); as.addActionListener(listener); } } else { throw new TagException(this.tag, "Parent is not of type ActionSource, type is: " + parent); } } }
/** * See taglib documentation. * * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext, * javax.faces.component.UIComponent) */ public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (parent instanceof EditableValueHolder) { if (ComponentSupport.isNew(parent)) { EditableValueHolder evh = (EditableValueHolder) parent; ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, ValueChangeListener.class); } ValueChangeListener listener = new LazyValueChangeListener( this.listenerType, b); evh.addValueChangeListener(listener); } } else { throw new TagException(this.tag, "Parent is not of type EditableValueHolder, type is: " + parent); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (parent == null) { throw new TagException(this.tag, "Parent UIComponent was null"); } // only process if the parent is new to the tree if (parent.getParent() == null) { String n = this.name.getValue(ctx); if (!parent.getAttributes().containsKey(n)) { if (this.value.isLiteral()) { parent.getAttributes().put(n, this.value.getValue()); } else { ELAdaptor.setExpression(parent, n, this.value .getValueExpression(ctx, Object.class)); } } } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (ComponentSupport.isNew(parent)) { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root == null) { throw new TagException(this.tag, "UIViewRoot not available"); } ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, PhaseListener.class); } PhaseListener pl = new LazyPhaseListener(this.listenerType, b); root.addPhaseListener(pl); } } }
throws IOException, FacesException, FaceletException, ELException { if (parent == null || !(parent instanceof ValueHolder)) { throw new TagException(this.tag, "Parent not an instance of ValueHolder: " + parent); throw new TagException(this.tag, "No Converter was created");
throw new TagException(tag, "Parent is not of type TabChangeSource, type is: " + parent);
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), getValueExpression(unlessAttribute, ctx, Boolean.class), getValueExpression(navigateAttribute, ctx, Boolean.class), getValueExpression(nameAttribute, ctx, String.class) ) ); } }
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;
throw new TagException(this.tag, "Parent UIComponent was null");