code: private boolean isValidElement() {
  
          boolean validElement = false;
          List elementList = new ArrayList();
          try {
              // get Elements of template stored in Property "template-elements"
              String elements = m_cmsObject.readPropertyObject(
                  m_template,
                  CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS,
                  false).getValue();
              // template may contain more than one Element
              // Elements are separated by the delimiter ","
              if (elements != null) {
                  StringTokenizer T = new StringTokenizer(elements, ",");
                  while (T.hasMoreTokens()) {
                      // current element probably looks like "body*|Body" <name><mandatory>|<nicename>
                      String currentElement = T.nextToken();
                      int sepIndex = currentElement.indexOf("|");
                      if (sepIndex != -1) {
                          // current element == "body*"
                          currentElement = currentElement.substring(0, sepIndex);
                      }
                      if (currentElement.endsWith("*")) {
                          // current element == "body"
                          currentElement = currentElement.substring(0, currentElement.length() - 1);
                      }
                      elementList.add(currentElement);
                  }
              }
              if (elementList.contains(m_element)) {
                  validElement = true;
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          return validElement;
      }
docs: Checks if m_element is valid element.<p>
  
  @return true if element is valid, otherwise false