5 Replies Latest reply on Nov 17, 2010 5:53 PM by sebastiantoro84

    getting static constants of a class

    sebastiantoro84

      hi I have this class:

       

      package cl.mejorencasa.pedido.modelos
      {

           public class Pedido implements IPedido
          {       
              public static const     ENESPERA:String   = "En Espera";
              public static const     ATENDIENDO:String   = "Atendiendo";
              public static const     ENCOCINA:String   = "En Cocina";
              public static const     FUERADECOCINA:String   = "Fuera de Cocina";
              public static const     ENCAMINO:String   = "En Camino";
              public static const     ENTREGADO:String   = "Entregado";
              public static const     PERDIDOPORREPARTIDOR:String   = "Pérdida por Repartidor";
              public static const     PERDIDOPORCOCINA:String   = "Pérdida por Cocina";
              public static const     CANCELADOPORCLIENTE:String   = "Cancelado por Cliente";
              public static const     CANCELADOPORFALTADEPRODUCTOS:String   = "Cancelado Falta Stock";               
             

      }

       

      what I want to do is to create a method that gets all the constants of that class and return them in a ArrayCollection. I must say that I want this method to be dynamic, what I mean is that I want it to go through every constant that are in the class. I don't wan't  to add them my self into an ArrayCollection.

       

      The problem is that I don't know how create such a metho, can someone help me?

       

      Thanks a lot.

       

      Sebastián Toro