GeoTools : AtomicTypes

This is a scratch page - for ideas on how to map XMLSchema atomic types to the type system.

decimal

BigDecimal

double

double

integer

BigInteger

int

Integer

...

...

Gabriels idea seems to be to create an Enumeration with the Bindings called AtomicTypes, the enumeration
would could contain the required restrictions and so on.

We may need to break out super types to pull this off.

interface FeatureType {
   List<Type> types();
}
class SimpleAttribtueType implements Type {
     // .. help ...
}
interface AtomicAttribtue extends Attribtue {
   AtomicAttributeType getAttributeType();
}

// Concrete Bindings (Based on XMLSchema)
class NumericAttribtue extends SimpleAttribute {
  Number getNumber();
  void setNumber( Number number )
}
class BooleanAttribtue extends SimpleAttribute {
  boolean getBoolean();
  void setBoolean( boolean value )
}
class TextAttribtue extends SimpleAttribute {
  String getString();
  void setText( String text );
}
...
class Atomics {
   static final TextAttribtue text( String name ){
      final AtomicType TEXT = new AtomicType( "string", String.class );
 
      class Text extends Atomic implements TextAttribtue {
          Text(){
             super( TEXT );
          }
          String text;
          String get(){
             return text;
          }
          String set( Object text ){
             this.text = (String) text;
          }
          String getString(){
             return text;
          }
          String setText( String text ){
             this.text = text;
          }
      }
      return new Text();
   }
   // ... etc for all XMLSChema Atomic types

   static final URI XML_SCHEMA = new URI( .... );

   class AtomicType implements Type {
      private GenericName name;
      private Class type;
      AtomicType( String name, Class type ){
         this.name = new GenericName( XML_SCHEMA, name );
         this.type = type;
      }
      GenericName getName(){
          return name;
      }
      Class getType(){
          return type;
      }
      boolean isNilable(){
         return false;
      }
    }
    abstract class Atomic implements Attribute {
      AtomicType type;
      Atomic( AtomicType type ){
         this.type = type;
      }
      String getName(){
         return type.getName().toString();
      }
      Type getType(){
         return type;
      }
   }


}