本文整理汇总了Java中javax.faces.view.facelets.TagAttribute.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TagAttribute.getValue方法的具体用法?Java TagAttribute.getValue怎么用?Java TagAttribute.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.view.facelets.TagAttribute
的用法示例。
在下文中一共展示了TagAttribute.getValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LiteralAccessKeyMetadata
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
public LiteralAccessKeyMetadata(
Method mainMethod,
Method accessKeyMethod,
TagAttribute attribute)
{
_mainMethod = mainMethod;
_accessKeyMethod = accessKeyMethod;
String text = attribute.getValue();
int accessKeyIndex = StringUtils.getMnemonicIndex(text);
if (accessKeyIndex != StringUtils.MNEMONIC_INDEX_NONE)
{
_accessKey = Character.valueOf(text.charAt(accessKeyIndex + 1));
text = StringUtils.stripMnemonic(text);
}
else
{
_accessKey = null;
}
_text = text;
_attribute = attribute;
}
示例2: setAttr
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
public void setAttr(FaceletContext ctx, String name, TagAttribute attr, UIComponent target) {
String value = attr.getValue(ctx);
target.getAttributes().put(name, value);
// value = new Object[] { ctx.getExpressionFactory().coerceToType(str, method.getParameterTypes()[0]) };
//
// try {
// method.invoke(instance, this.value);
// } catch (InvocationTargetException e) {
// throw new TagAttributeException(this.attribute, e.getCause());
// } catch (Exception e) {
// throw new TagAttributeException(this.attribute, e);
// }
// if (targetExpr != null) {
// ValueExpression srcExpr = attr.getValueExpression(ctx, targetExpr.getType(elContext));
// targetExpr.setValue(elContext, value);
// } else {
// ExpressionFactory exprFactory = ctx.getFacesContext().getApplication().getExpressionFactory();
// targetExpr = exprFactory.createValueExpression(elContext, "#{" + name + "}", value.getClass());
// target.setValueExpression(name, targetExpr);
// targetExpr.setValue(elContext, value);
// }
}
示例3: containsAdvancesSearchExpression
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
private boolean containsAdvancesSearchExpression(Tag tag, String attribute) {
boolean changeIt = false;
TagAttribute forAttribute = tag.getAttributes().get(attribute);
if (null != forAttribute) {
String value = forAttribute.getValue();
if (value.contains("*"))
changeIt = true;
if (value.contains("@"))
changeIt = true;
if (value.equals("@form") || value.equals("@none") || value.equals("@this") || value.equals("@all"))
changeIt = false;
if (value.startsWith("#{"))
changeIt = false;
}
return changeIt;
}
示例4: containsAdvancesSearchExpression
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
private boolean containsAdvancesSearchExpression(Tag tag, String attribute) {
boolean changeIt=false;
TagAttribute forAttribute = tag.getAttributes().get(attribute);
if (null != forAttribute) {
String value = forAttribute.getValue();
if (value.contains("*"))
changeIt=true;
if (value.contains("@"))
changeIt=true;
if (value.equals("@form") || value.equals("@none") || value.equals("@this") || value.equals("@all"))
changeIt=false;
if (value.startsWith("#{"))
changeIt=false;
}
return changeIt;
}
示例5: getAttributeValue
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
private String getAttributeValue(FaceletContext faceletContext, TagAttribute tagAttribute, boolean evaluate) {
String value = null;
if (tagAttribute != null) {
if (evaluate) {
ValueExpression expression = tagAttribute.getValueExpression(faceletContext, String.class);
value = (String) expression.getValue(faceletContext.getFacesContext().getELContext());
}
else {
value = tagAttribute.getValue();
}
}
return value;
}
示例6: JKTagAttributeWrapper
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
/**
* Instantiates a new JK tag attribute wrapper.
*
* @param tagAttribute
* the tag attribute
*/
public JKTagAttributeWrapper(final TagAttribute tagAttribute) {
this.tagAttribute = tagAttribute;
this.qName = tagAttribute.getQName();
this.value = tagAttribute.getValue();
this.localName = tagAttribute.getLocalName();
this.namespace = tagAttribute.getNamespace();
this.location = tagAttribute.getLocation();
}
示例7: convertTagAttribute
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
protected TagAttribute convertTagAttribute(TagAttribute attribute) {
Location location = attribute.getLocation();
String ns = attribute.getNamespace();
String myLocalName = attribute.getLocalName();
String qName;
String value = attribute.getValue();
if (Namespace.jsf.uri.equals(attribute.getNamespace())) {
// make this a component attribute
qName = myLocalName;
ns = "";
} else {
if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) {
// the attribute has a different namespace than the tag.
// preserve it.
return attribute;
}
if (attribute.getLocalName().equals(otherHtmlIdAttribute)) {
// special case for input name
qName = "id";
myLocalName = "id";
} else {
// make this a pass through attribute
qName = "h:" + myLocalName;
ns = Namespace.h.uri;
}
}
return TagAttributeUtilities.createTagAttribute(location, ns, myLocalName, qName, value);
}
示例8: getAttrValue
import javax.faces.view.facelets.TagAttribute; //导入方法依赖的package包/类
private String getAttrValue(FaceletContext ctx, TagAttribute attr) {
String value;
if (attr.isLiteral()) {
value = attr.getValue(ctx);
} else {
ValueExpression expression = attr.getValueExpression(ctx, String.class);
value = (String) expression.getValue(ctx);
}
return value;
}