private void generate(Index index) throws SAXException {
  if (index == null) {
    return;
  }
  AttributesImpl atts=new AttributesImpl();
  if (index instanceof IndexCreationData) {
    IndexCreationData indexData=(IndexCreationData)index;
    atts.addAttribute("","",NAME,"",indexData.getIndexName());
    String indexType=indexData.getIndexType();
    if (indexType.equals("KEY")) {
      atts.addAttribute("","",KEY_INDEX,"","true");
    }
 else {
      if (indexType.equals("HASH")) {
        indexType=HASH_INDEX_TYPE;
      }
 else {
        indexType=RANGE_INDEX_TYPE;
      }
      atts.addAttribute("","",KEY_INDEX,"","false");
      atts.addAttribute("","",INDEX_TYPE,"","" + indexType);
    }
    atts.addAttribute("","",FROM_CLAUSE,"",indexData.getIndexFromClause());
    atts.addAttribute("","",EXPRESSION,"",indexData.getIndexExpression());
  }
 else {
    atts.addAttribute("","",NAME,"",index.getName());
    if (index instanceof PrimaryKeyIndex) {
      atts.addAttribute("","",KEY_INDEX,"","true");
    }
 else {
      atts.addAttribute("","",KEY_INDEX,"","false");
      String indexType="range";
      if (index instanceof HashIndex) {
        indexType="hash";
      }
      atts.addAttribute("","",INDEX_TYPE,"","" + indexType);
    }
    atts.addAttribute("","",FROM_CLAUSE,"",index.getFromClause());
    atts.addAttribute("","",EXPRESSION,"",index.getIndexedExpression());
  }
  handler.startElement("",INDEX,INDEX,atts);
  handler.endElement("",INDEX,INDEX);
}

private void generate ( Index index ) throws SAXException { if ( index == null ) { return ; } AttributesImpl atts = new AttributesImpl ( ) ; if ( index instanceof IndexCreationData ) { IndexCreationData indexData = ( IndexCreationData ) index ; atts . addAttribute ( "" , "" , NAME , "" , indexData . getIndexName ( ) ) ; String indexType = indexData . getIndexType ( ) ; if ( indexType . equals ( "KEY" ) ) { atts . addAttribute ( "" , "" , KEY_INDEX , "" , "true" ) ; } else { if ( indexType . equals ( "HASH" ) ) { indexType = HASH_INDEX_TYPE ; } else { indexType = RANGE_INDEX_TYPE ; } atts . addAttribute ( "" , "" , KEY_INDEX , "" , "false" ) ; atts . addAttribute ( "" , "" , INDEX_TYPE , "" , "" + indexType ) ; } atts . addAttribute ( "" , "" , FROM_CLAUSE , "" , indexData . getIndexFromClause ( ) ) ; atts . addAttribute ( "" , "" , EXPRESSION , "" , indexData . getIndexExpression ( ) ) ; } else { atts . addAttribute ( "" , "" , NAME , "" , index . getName ( ) ) ; if ( index instanceof PrimaryKeyIndex ) { atts . addAttribute ( "" , "" , KEY_INDEX , "" , "true" ) ; } else { atts . addAttribute ( "" , "" , KEY_INDEX , "" , "false" ) ; String indexType = "range" ; if ( index instanceof HashIndex ) { indexType = "hash" ; } atts . addAttribute ( "" , "" , INDEX_TYPE , "" , "" + indexType ) ; } atts . addAttribute ( "" , "" , FROM_CLAUSE , "" , index . getFromClause ( ) ) ; atts . addAttribute ( "" , "" , EXPRESSION , "" , index . getIndexedExpression ( ) ) ; } handler . startElement ( "" , INDEX , INDEX , atts ) ; handler . endElement ( "" , INDEX , INDEX ) ; }
generates xml for an index
