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


Java TagData类代码示例

本文整理汇总了Java中javax.servlet.jsp.tagext.TagData的典型用法代码示例。如果您正苦于以下问题:Java TagData类的具体用法?Java TagData怎么用?Java TagData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TagData类属于javax.servlet.jsp.tagext包,在下文中一共展示了TagData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Return information about the scripting variables to be created.
 */
public VariableInfo[] getVariableInfo(TagData data) {
  // get the type
  String type = (String)data.getAttribute("type");

  // make it an object if none supplied
  if (type == null) {
    type = "java.lang.Object";
  }

  // return the infor about the deined object
  VariableInfo[] vinfo = new VariableInfo[1];
  vinfo[0] = new VariableInfo(data.getAttributeString("id"),
                              type, true, VariableInfo.AT_END );

  /* return the results */
  return vinfo;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:NestedDefineTei.java

示例2: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Return information about the scripting variables to be created.
 */
public VariableInfo[] getVariableInfo(TagData data) {

    String type = (String)data.getAttribute("type");
    Object name = data.getAttribute("name");
    Object value = data.getAttribute("value");
    if (type == null) {
        if ( (value!=null) ||  (name==null) )
            type = "java.lang.String";
        else 
            type = "java.lang.Object";
    }

    return new VariableInfo[] {
      new VariableInfo(data.getAttributeString("id"),
                       type,
                       true,
                       VariableInfo.AT_END )
    };

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:DefineTei.java

示例3: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
    * Return information about the scripting variables to be created.
    */
   public VariableInfo[] getVariableInfo(TagData data) {

       String type = null;
       String property = data.getAttributeString("property");
       if ("application".equalsIgnoreCase(property))
           type = "javax.servlet.ServletContext";
       else if ("config".equalsIgnoreCase(property))
           type = "javax.servlet.ServletConfig";
       else if ("request".equalsIgnoreCase(property))
           type = "javax.servlet.ServletRequest";
       else if ("response".equalsIgnoreCase(property))
           type = "javax.servlet.ServletResponse";
       else if ("session".equalsIgnoreCase(property))
           type = "javax.servlet.http.HttpSession";
       else
           type = "java.lang.Object";

return new VariableInfo[] {
  new VariableInfo(data.getAttributeString("id"),
                   type,
                   true,
                   VariableInfo.AT_BEGIN)
};

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:PageTei.java

示例4: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
    * Return information about the scripting variables to be created.
    */
   public VariableInfo[] getVariableInfo(TagData data) {

       String className = null;
       if (data.getAttribute("multiple") == null)
           className = "java.lang.String";
       else
           className = "java.lang.String[]";
return new VariableInfo[] {
  new VariableInfo(data.getAttributeString("id"),
                          className,
                   true,
                   VariableInfo.AT_BEGIN)
};

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:HeaderTei.java

示例5: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
    * Return information about the scripting variables to be created.
    */
   public VariableInfo[] getVariableInfo(TagData data) {

       String type = null;
       if (data.getAttribute("input") == null)
           type = "java.lang.String";
       else
           type = "java.io.InputStream";
return new VariableInfo[] {
  new VariableInfo(data.getAttributeString("id"),
                   type,
                   true,
                   VariableInfo.AT_BEGIN)
};

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:ResourceTei.java

示例6: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
    * Return information about the scripting variables to be created.
    */
   public VariableInfo[] getVariableInfo(TagData data) {

       String className = null;
       if (data.getAttribute("multiple") == null)
           className = "javax.servlet.http.Cookie";
       else
           className = "javax.servlet.http.Cookie[]";
return new VariableInfo[] {
  new VariableInfo(data.getAttributeString("id"),
                   className,
                   true,
                   VariableInfo.AT_BEGIN)
};

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:CookieTei.java

示例7: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
    * Return information about the scripting variables to be created.
    */
   public VariableInfo[] getVariableInfo(TagData data) {

       String type = null;
       if (data.getAttribute("formBean") != null)
           type = "org.apache.struts.action.ActionFormBean";
       else if (data.getAttribute("forward") != null)
           type = "org.apache.struts.action.ActionForward";
       else if (data.getAttribute("mapping") != null)
           type = "org.apache.struts.action.ActionMapping";
       else
           type = "java.lang.Object";

return new VariableInfo[] {
  new VariableInfo(data.getAttributeString("id"),
                   type,
                   true,
                   VariableInfo.AT_BEGIN)
};

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:StrutsTei.java

示例8: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
   * Return information about the scripting variables to be created.
   */
  public VariableInfo[] getVariableInfo(TagData data) {

    String classname = data.getAttributeString("classname");
    if( classname == null )
      classname = "java.lang.Object";
    String id = data.getAttributeString("id");
    if( id == null )
      id = data.getAttributeString("name");

    return new VariableInfo[] {
    new VariableInfo(id,
                     classname,
                     true,
                     VariableInfo.AT_END)
};

  }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:UseAttributeTei.java

示例9: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/** Returns an array of length two, for the variables exposed. */
@Override
public VariableInfo[] getVariableInfo(TagData data) {
    VariableInfo[]  scriptVars = new VariableInfo[2];

    scriptVars[0] = new VariableInfo("index",
                                     "java.lang.Number",
                                     true,
                                     VariableInfo.NESTED);

    // TODO: ValidationError should expose properties like field name
    scriptVars[1] = new VariableInfo("error",
                                     ValidationError.class.getName(),
                                     true,
                                     VariableInfo.NESTED);

    return scriptVars;
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:19,代码来源:ErrorsTagExtraInfo.java

示例10: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Attempts to return type information so that the container can create a
 * named variable for the action bean.
 */
@Override public VariableInfo[] getVariableInfo(final TagData tag) {
    // We can only provide the type of 'var' if beanclass was used because
    // if binding was used we need runtime information!
    Object beanclass = tag.getAttribute("beanclass");

    // Turns out beanclass="${...}" does NOT return TagData.REQUEST_TIME_VALUE; only beanclass="<%= ... %>".
    if (beanclass != null && !beanclass.equals(TagData.REQUEST_TIME_VALUE)) {
        String var = tag.getAttributeString("var");
        if (var == null) var = tag.getAttributeString("id");

        // Make sure we have the class name, not the class
        if (beanclass instanceof Class<?>) beanclass = ((Class<?>) beanclass).getName();

        // Return the variable info
        if (beanclass instanceof String) {
            String string = (String) beanclass;
            if (!string.startsWith("${")) {
                return new VariableInfo[] { new VariableInfo(var, string, true, VariableInfo.AT_BEGIN) };
            }
        }
    }
    return NO_INFO;
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:28,代码来源:UseActionBeanTagExtraInfo.java

示例11: validate

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Checks to ensure that where the tag supports providing one of two attributes
 * that one and only one is provided.
 */
@Override public ValidationMessage[] validate(final TagData tag) {
    Collection<ValidationMessage> errors = new ArrayList<ValidationMessage>();

    Object beanclass = tag.getAttribute("beanclass");
    Object binding   = tag.getAttribute("binding");
    if (!(beanclass != null ^ binding != null)) {
        errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'beanclass' or 'binding' must be supplied."));
    }

    String var = tag.getAttributeString("var");
    String id  = tag.getAttributeString("id");
    if (!(var != null ^ id != null)) {
        errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'var' or 'id' must be supplied."));
    }

    return errors.toArray(new ValidationMessage[errors.size()]);
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:22,代码来源:UseActionBeanTagExtraInfo.java

示例12: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Return information about the scripting variables to be created.
 */
public VariableInfo[] getVariableInfo(TagData data) {
    /* the id parameter */
    String id = data.getAttributeString("id");

    VariableInfo[] vi = null;

    if (id != null) {
        vi = new VariableInfo[1];
        vi[0] =
            new VariableInfo(id, "java.lang.String", true,
                VariableInfo.AT_END);
    } else {
        vi = new VariableInfo[0];
    }

    // job done
    return vi;
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:22,代码来源:NestedWriteNestingTei.java

示例13: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Return information about the scripting variables to be created.
 */
public VariableInfo[] getVariableInfo(TagData data) {
    // get the type
    String type = (String) data.getAttribute("type");

    // make it an object if none supplied
    if (type == null) {
        type = "java.lang.Object";
    }

    // return the infor about the deined object
    VariableInfo[] vinfo = new VariableInfo[1];

    vinfo[0] =
        new VariableInfo(data.getAttributeString("id"), type, true,
            VariableInfo.AT_END);

    /* return the results */
    return vinfo;
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:23,代码来源:NestedDefineTei.java

示例14: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Return information about the scripting variables to be created.
 */
public VariableInfo[] getVariableInfo(TagData data) {
    String type = (String) data.getAttribute("type");
    Object name = data.getAttribute("name");
    Object value = data.getAttribute("value");

    if (type == null) {
        if ((value != null) || (name == null)) {
            type = "java.lang.String";
        } else {
            type = "java.lang.Object";
        }
    }

    return new VariableInfo[] {
        new VariableInfo(data.getAttributeString("id"), type, true,
            VariableInfo.AT_END)
    };
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:22,代码来源:DefineTei.java

示例15: getVariableInfo

import javax.servlet.jsp.tagext.TagData; //导入依赖的package包/类
/**
 * Return information about the scripting variables to be created.
 */
public VariableInfo[] getVariableInfo(TagData data) {
    String type = null;
    String property = data.getAttributeString("property");

    if ("application".equalsIgnoreCase(property)) {
        type = "javax.servlet.ServletContext";
    } else if ("config".equalsIgnoreCase(property)) {
        type = "javax.servlet.ServletConfig";
    } else if ("request".equalsIgnoreCase(property)) {
        type = "javax.servlet.ServletRequest";
    } else if ("response".equalsIgnoreCase(property)) {
        type = "javax.servlet.ServletResponse";
    } else if ("session".equalsIgnoreCase(property)) {
        type = "javax.servlet.http.HttpSession";
    } else {
        type = "java.lang.Object";
    }

    return new VariableInfo[] {
        new VariableInfo(data.getAttributeString("id"), type, true,
            VariableInfo.AT_BEGIN)
    };
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:27,代码来源:PageTei.java


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