-public class DefaultBindingFactory extends TypeBindingFactory {\r
- \r
- /**\r
- * Construct a binding factory.\r
- */\r
- public DefaultBindingFactory() {\r
- super();\r
- }\r
- \r
- /**\r
- * Construct a scheme factory that appends constructed bindings to the user given\r
- * repository \r
- * \r
- * @param repository repository where bindings are placed\r
- */\r
- public DefaultBindingFactory(Map<Datatype, Binding> repository) {\r
- super(repository);\r
- }\r
-\r
- @Override\r
- protected Binding doConstruct(Datatype type)\r
- throws BindingConstructionException {\r
-\r
- // Exact, non-annotated types\r
- if (type.equals( Bindings.BOOLEAN.type() )) return Bindings.BOOLEAN;\r
- if (type.equals( Bindings.BYTE.type() )) return Bindings.BYTE;\r
- if (type.equals( Bindings.INTEGER.type() )) return Bindings.INTEGER;\r
- if (type.equals( Bindings.LONG.type() )) return Bindings.LONG;\r
- if (type.equals( Bindings.FLOAT.type() )) return Bindings.FLOAT;\r
- if (type.equals( Bindings.DOUBLE.type() )) return Bindings.DOUBLE;\r
- if (type.equals( Bindings.STRING.type() )) return Bindings.STRING;\r
- if (type.equals( Bindings.VARIANT.type() )) return Bindings.VARIANT;\r
- if (type.equals( Bindings.BOOLEAN_ARRAY.type() )) return Bindings.BOOLEAN_ARRAY;\r
- if (type.equals( Bindings.BYTE_ARRAY.type() )) return Bindings.BYTE_ARRAY;\r
- if (type.equals( Bindings.INT_ARRAY.type() )) return Bindings.INT_ARRAY;\r
- if (type.equals( Bindings.LONG_ARRAY.type() )) return Bindings.LONG_ARRAY;\r
- if (type.equals( Bindings.FLOAT_ARRAY.type() )) return Bindings.FLOAT_ARRAY;\r
- if (type.equals( Bindings.DOUBLE_ARRAY.type() )) return Bindings.DOUBLE_ARRAY;\r
- if (type.equals( Bindings.BOOLEAN_ARRAY.type() )) return Bindings.BOOLEAN_ARRAY;\r
- if (type.equals( Bindings.STRING_ARRAY.type() )) return Bindings.STRING_ARRAY;\r
- \r
- // Annotated types \r
- if (type instanceof BooleanType) return new BooleanBindingDefault((BooleanType)type);\r
- if (type instanceof DoubleType) return new DoubleBindingDefault((DoubleType)type);\r
- if (type instanceof FloatType) return new FloatBindingDefault((FloatType)type);\r
- if (type instanceof ByteType) return new ByteBindingDefault((ByteType)type);\r
- if (type instanceof IntegerType) return new IntegerBindingDefault((IntegerType)type);\r
- if (type instanceof LongType) return new LongBindingDefault((LongType)type);\r
- if (type instanceof StringType) return new StringBindingDefault((StringType)type);\r
- \r
- // Constructed types\r
+public class DefaultBindingFactory extends TypeBindingFactory {
+
+ /**
+ * Construct a binding factory.
+ */
+ public DefaultBindingFactory() {
+ super();
+ }
+
+ /**
+ * Construct a scheme factory that appends constructed bindings to the user given
+ * repository
+ *
+ * @param repository repository where bindings are placed
+ */
+ public DefaultBindingFactory(Map<Datatype, Binding> repository) {
+ super(repository);
+ }
+
+ @Override
+ protected Binding doConstruct(Datatype type)
+ throws BindingConstructionException {
+
+ // Exact, non-annotated types
+ if (type.equals( Bindings.BOOLEAN.type() )) return Bindings.BOOLEAN;
+ if (type.equals( Bindings.BYTE.type() )) return Bindings.BYTE;
+ if (type.equals( Bindings.INTEGER.type() )) return Bindings.INTEGER;
+ if (type.equals( Bindings.LONG.type() )) return Bindings.LONG;
+ if (type.equals( Bindings.FLOAT.type() )) return Bindings.FLOAT;
+ if (type.equals( Bindings.DOUBLE.type() )) return Bindings.DOUBLE;
+ if (type.equals( Bindings.STRING.type() )) return Bindings.STRING;
+ if (type.equals( Bindings.VARIANT.type() )) return Bindings.VARIANT;
+ if (type.equals( Bindings.BOOLEAN_ARRAY.type() )) return Bindings.BOOLEAN_ARRAY;
+ if (type.equals( Bindings.BYTE_ARRAY.type() )) return Bindings.BYTE_ARRAY;
+ if (type.equals( Bindings.INT_ARRAY.type() )) return Bindings.INT_ARRAY;
+ if (type.equals( Bindings.LONG_ARRAY.type() )) return Bindings.LONG_ARRAY;
+ if (type.equals( Bindings.FLOAT_ARRAY.type() )) return Bindings.FLOAT_ARRAY;
+ if (type.equals( Bindings.DOUBLE_ARRAY.type() )) return Bindings.DOUBLE_ARRAY;
+ if (type.equals( Bindings.BOOLEAN_ARRAY.type() )) return Bindings.BOOLEAN_ARRAY;
+ if (type.equals( Bindings.STRING_ARRAY.type() )) return Bindings.STRING_ARRAY;
+
+ // Annotated types
+ if (type instanceof BooleanType) return new BooleanBindingDefault((BooleanType)type);
+ if (type instanceof DoubleType) return new DoubleBindingDefault((DoubleType)type);
+ if (type instanceof FloatType) return new FloatBindingDefault((FloatType)type);
+ if (type instanceof ByteType) return new ByteBindingDefault((ByteType)type);
+ if (type instanceof IntegerType) return new IntegerBindingDefault((IntegerType)type);
+ if (type instanceof LongType) return new LongBindingDefault((LongType)type);
+ if (type instanceof StringType) return new StringBindingDefault((StringType)type);
+
+ // Constructed types