Package org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional

Examples of org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDVariable


   */
  private void addVariables(List results, CMNode node, ITextRegionCollection customTag) {
    List list = ((TLDElementDeclaration) node).getVariables();
    Iterator it = list.iterator();
    while (it.hasNext()) {
      TLDVariable var = (TLDVariable) it.next();
      if (!var.getDeclare())
        continue;

      String varName = var.getNameGiven();
      if (varName == null) {
        // 2.0
        varName = var.getAlias();
      }
      if (varName == null) {
        String attrName = var.getNameFromAttribute();
        /*
         * Iterate through the document region to find the
         * corresponding attribute name, and then use its value
         */
        ITextRegionList regions = customTag.getRegions();
        boolean attrNameFound = false;
        for (int i = 2; i < regions.size(); i++) {
          ITextRegion region = regions.get(i);
          if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(region.getType())) {
            attrNameFound = attrName.equals(customTag.getText(region));
          }
          if (attrNameFound && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(region.getType())) {
            varName = StringUtils.strip(customTag.getText(region));
          }
        }
      }
      if (varName != null) {
        String varClass = "java.lang.String"; // the default
        // class...//$NON-NLS-1$
        if (var.getVariableClass() != null) {
          varClass = var.getVariableClass();
        }
        results.add(new TaglibVariable(varClass, varName, var.getScope(), var.getDescription()));
      }
    }
  }
View Full Code Here


   */
  private void addVariables(List results, CMNode node, ITextRegionCollection customTag) {
    List list = ((TLDElementDeclaration) node).getVariables();
    Iterator it = list.iterator();
    while (it.hasNext()) {
      TLDVariable var = (TLDVariable) it.next();
      if (!var.getDeclare())
        continue;

      String varName = var.getNameGiven();
      if (varName == null) {
        // 2.0
        varName = var.getAlias();
      }
      if (varName == null) {
        String attrName = var.getNameFromAttribute();
        /*
         * Iterate through the document region to find the
         * corresponding attribute name, and then use its value
         */
        ITextRegionList regions = customTag.getRegions();
        boolean attrNameFound = false;
        for (int i = 2; i < regions.size(); i++) {
          ITextRegion region = regions.get(i);
          if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(region.getType())) {
            attrNameFound = attrName.equals(customTag.getText(region));
          }
          if (attrNameFound && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(region.getType())) {
            varName = StringUtils.strip(customTag.getText(region));
          }
        }
      }
      if (varName != null) {
        String varClass = "java.lang.String"; // the default
        // class...//$NON-NLS-1$
        if (var.getVariableClass() != null) {
          varClass = var.getVariableClass();
        }
        results.add(new TaglibVariable(varClass, varName, var.getScope(), var.getDescription()));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDVariable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.