/** * Creates an object based on the description. * * @return The object. */ public Object createObject() { final Dimension2D dim = new FloatDimension(); final float width = getFloatParameter("width"); final float height = getFloatParameter("height"); dim.setSize(width, height); return dim; }
/** * DefaultConstructor. Creates the object factory for all java base classes. */ public JavaBaseClassFactory() { registerClass(Dimension.class, new DimensionObjectDescription()); registerClass(Dimension2D.class, new Dimension2DObjectDescription()); registerClass(FloatDimension.class, new BeanObjectDescription(FloatDimension.class)); registerClass(Date.class, new DateObjectDescription()); registerClass(Boolean.TYPE, new BooleanObjectDescription()); registerClass(Byte.TYPE, new ByteObjectDescription()); registerClass(Double.TYPE, new DoubleObjectDescription()); registerClass(Float.TYPE, new FloatObjectDescription()); registerClass(Integer.TYPE, new IntegerObjectDescription()); registerClass(Long.TYPE, new LongObjectDescription()); registerClass(Short.TYPE, new ShortObjectDescription()); registerClass(Character.TYPE, new CharacterObjectDescription()); registerClass(Character.class, new CharacterObjectDescription()); registerClass(Boolean.class, new BooleanObjectDescription()); registerClass(Byte.class, new ByteObjectDescription()); registerClass(Double.class, new DoubleObjectDescription()); registerClass(Float.class, new FloatObjectDescription()); registerClass(Integer.class, new IntegerObjectDescription()); registerClass(Long.class, new LongObjectDescription()); registerClass(Short.class, new ShortObjectDescription()); registerClass(Line2D.class, new Line2DObjectDescription()); registerClass(Point2D.class, new Point2DObjectDescription()); registerClass(Rectangle2D.class, new Rectangle2DObjectDescription()); registerClass(String.class, new StringObjectDescription()); registerClass(Color.class, new ColorObjectDescription()); registerClass(BasicStroke.class, new BasicStrokeObjectDescription()); registerClass(Object.class, new ClassLoaderObjectDescription()); registerClass(Format.class, new ClassLoaderObjectDescription()); registerClass(NumberFormat.class, createNumberFormatDescription()); registerClass(DecimalFormat.class, new DecimalFormatObjectDescription()); registerClass(DecimalFormatSymbols.class, createDecimalFormatSymbols()); registerClass(DateFormat.class, new ClassLoaderObjectDescription()); registerClass(SimpleDateFormat.class, new SimpleDateFormatObjectDescription()); registerClass(DateFormatSymbols.class, new ClassLoaderObjectDescription()); registerClass(ArrayList.class, new CollectionObjectDescription(ArrayList.class)); registerClass(Vector.class, new CollectionObjectDescription(Vector.class)); registerClass(HashSet.class, new CollectionObjectDescription(HashSet.class)); registerClass(TreeSet.class, new CollectionObjectDescription(TreeSet.class)); registerClass(Set.class, new CollectionObjectDescription(HashSet.class)); registerClass(List.class, new CollectionObjectDescription(ArrayList.class)); registerClass(Collection.class, new CollectionObjectDescription(ArrayList.class)); }