本文整理匯總了Java中javax.faces.view.facelets.TagException類的典型用法代碼示例。如果您正苦於以下問題:Java TagException類的具體用法?Java TagException怎麽用?Java TagException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TagException類屬於javax.faces.view.facelets包,在下文中一共展示了TagException類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ACLChooseTagHandler
import javax.faces.view.facelets.TagException; //導入依賴的package包/類
public ACLChooseTagHandler(TagConfig config) {
super(config);
FaceletHandler itr = nextHandler;
if (itr instanceof CompositeFaceletHandler) {
FaceletHandler[] handlers = ((CompositeFaceletHandler) itr).getHandlers();
if (handlers != null && handlers.length > 0 && handlers[0] instanceof ACLWhenTagHandler) {
when = (ACLWhenTagHandler) handlers[0];
} else {
throw new TagException(tag, "isAllowedChoose Tag must have a isAllowedWhen Tag");
}
if (handlers.length > 1) {
FaceletHandler itr2 = handlers[1];
if (itr2 instanceof ACLOtherwiseTagHandler) {
otherwise = (ACLOtherwiseTagHandler) itr2;
}
}
} else {
throw new TagException(tag, "isAllowedChoose Tag must have a CompositeFaceletHandler Tag");
}
}
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:23,代碼來源:ACLChooseTagHandler.java
示例2: getMetadataTarget
import javax.faces.view.facelets.TagException; //導入依賴的package包/類
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;
}
示例3: apply
import javax.faces.view.facelets.TagException; //導入依賴的package包/類
@Override
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException, TagException
{
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper != null && varMapper instanceof CompositeVariableMapper)
{
CompositeVariableMapper compositeVarMapper = (CompositeVariableMapper) varMapper;
String strName = this.name.getValue();
ValueExpression valueExpression = compositeVarMapper.resolveOverloadedVariable(strName);
if (valueExpression == null)
{
if (this.required != null && this.required.getBoolean(ctx))
{
throw new TagException(tag, "Attribute \"" + strName + "\" is required!");
}
if (defaultValue != null)
{
valueExpression = defaultValue.getValueExpression(ctx, Object.class);
}
else
{
valueExpression = null;
}
}
else
{
if (this.deprecated != null && this.deprecated.getBoolean(ctx))
{
throw new TagException(tag, "Attribute \"" + strName + "\" is deprecated!");
}
}
if (valueExpression != null && this.isMethodParam != null && this.isMethodParam.getBoolean(ctx))
{
// A method expression that wraps the value expression and uses its own invoke method to get the value from the wrapped expression.
MethodExpression methodExpression = new MethodExpressionValueExpressionAdapter(valueExpression);
// Using the variable mapper so the expression is scoped to the body of
// the Facelets tag. Since the variable mapper only accepts
// value expressions, we once again wrap it by a value expression that
// directly returns the method expression.
valueExpression = ctx.getExpressionFactory().createValueExpression(methodExpression, MethodExpression.class);
}
boolean propagate = (this.propagate != null && this.propagate.getBoolean(ctx));
if (!compositeVarMapper.addParam(strName, valueExpression, propagate))
{
throw new TagException(tag, "Attribute duplicate declaration! Attribute name: " + strName);
}
}
}