public int doStartTag() throws JspException {

    PNTag pnTag = (PNTag) this.getParent();
    if (pnTag == null) return Tag.SKIP_BODY;
    pn = pnTag.getPn();
    if (pn == null || !(pn instanceof EPN)) return Tag.SKIP_BODY;

    EPN epn = (EPN) pn;

    int seq = Integer.parseInt(sequence);
    attributeMeta = epn.getSortedAttributeMeta(seq);
    if (attributeMeta == null) return Tag.SKIP_BODY;

    if (!attributeMeta.hasActivated()) return Tag.SKIP_BODY;

    pageContext.setAttribute("attributeTitle", attributeMeta.getAttributeTitle());
    pageContext.setAttribute("attributeIndex", attributeMeta.getAttributeIndex() + "");

    return EVAL_BODY_INCLUDE;
  }
 public AttributeValue getSelectedAttributeValue() {
   return ((EPN) this.pn).getAttributeValue(attributeMeta.getAttributeIndex());
 }
 /**
  * Constructor.
  *
  * @param attributeMeta the meta data of attribute
  * @throws NullPointerException if the attributeMeta parameter is null
  */
 public DescCriterion(AttributeMeta<?, ?> attributeMeta) throws NullPointerException {
   super(attributeMeta);
   sort = new Sort(attributeMeta.getName(), SortDirection.DESCENDING);
 }