当前位置: 首页>>代码示例>>Java>>正文


Java TagException类代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:14,代码来源:MetaTagHandler.java

示例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);
		}
	}
}
 
开发者ID:skybber,项目名称:Tagext,代码行数:58,代码来源:CompositeTagParamHandler.java


注:本文中的javax.faces.view.facelets.TagException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。