package projectv1a; /** * Clase AttributeSpecification * * Se utiliza para indicar los atributos de la clase especificada en * ClassSpecification. * * La declaramos como abstracta, ya que tiene dos subclases que serán las que * realmente serán instanciadas. */ public abstract class AttributeSpecification{ //There must be a intance of this class for each attribute that the class has. private String name; /* //LO HAREMOS DE LA MANERA INDICADA EN LA DOCUMENTACIÓN DE CASTOR public enum Type { BOOLEAN, INTEGER, FLOAT, DOUBLE, STRING } */ //private Type type; // ¿¿¿¿¿¿¿Debería ser final???????? private TypeEnum type; private AllowedValues allowedValues; // Lista de valores permitidos private boolean storage; // para saber si es static(variable de clase o de instancia) private int access; // lectura, lectura+escritura, escritura private boolean propagation; // Heredable o no private boolean patternMatch; private boolean multi; // true: Multivaluado || false: Simple //CASTOR private ClassSpecification classSpecification; private int identity; ///////////// CONSTRUCTORES ///////////// public AttributeSpecification(){ } public AttributeSpecification(String n){ name = n; type = TypeEnum.INTEGER_TYPE; patternMatch = false; } public AttributeSpecification(String n, TypeEnum t, boolean pM) { name = n; type = t; patternMatch = pM; // mirar AllowedValues para que esté en el constructor } ///////////////////////////////////////// public int getId(){ return identity; } public void setId(int i){ identity = i; } public String getName(){ return name; } public AllowedValues getAllowedValues(){ return allowedValues; } public boolean getStorage(){ return storage; } public int getAccess(){ return access; } public boolean getPropagation(){ return propagation; } public boolean getPM(){ return patternMatch; } public boolean getMulti(){ return multi; } public TypeEnum getType(){ return type; } public void setName(String n){ name = n; } public void setAllowedValues(AllowedValues a){ allowedValues = a; } public void setStorage(boolean s){ storage = s; } public void setAccess(int a){ access = a; } public void setPropagation(boolean p){ propagation = p; } public void setPM(boolean pm){ patternMatch = pm; } public void setMulti(boolean m){ multi = m; } public void setType(TypeEnum t){ type = t; } // PARA CASTOR public ClassSpecification getClassSpecification(){ return classSpecification; } public void setClassSpecification(ClassSpecification classSp){ classSpecification = classSp; } }