Logo
Distributed Genetic Programming Framework
print print

File org.jfree.xml.factory.objects.JavaBaseClassFactory.java

Here you can find all the information about the file org.jfree.xml.factory.objects.JavaBaseClassFactory.java. You may explore it here or download it onto your local disk.
/* ========================================================================
 * JCommon : a free general purpose class library for the Java(tm) platform
 * ========================================================================
 *
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
 * 
 * Project Info:  http://www.jfree.org/jcommon/index.html
 *
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License as published by 
 * the Free Software Foundation; either version 2.1 of the License, or 
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 *
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 *
 * -------------------------
 * JavaBaseClassFactory.java
 * -------------------------
 * (C)opyright 2003, 2004, by Thomas Morgner and Contributors.
 *
 * Original Author:  Thomas Morgner (taquera@sherito.org);
 * Contributor(s):   David Gilbert (for Object Refinery Limited);
 *
 * $Id: JavaBaseClassFactory.java,v 1.3 2005/11/14 11:02:34 mungady Exp $
 *
 * Changes
 * -------
 * 14-Apr-2003 : Initial version
 * 29-Apr-2003 : Distilled from the JFreeReport project and moved into JCommon
 * 13-Jan-2004 : Did not handle java.awt.Dimension objects correctly.
 */

package org.jfree.xml.factory.objects;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.geom.Dimension2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.text.DateFormat;
import java.text.DateFormatSymbols;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.Format;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;

import org.jfree.ui.FloatDimension;

/**
 * A default factory for all commonly used java base classes from java.lang, java.awt
 * etc.
 *
 * @author Thomas Morgner
 */

public class JavaBaseClassFactory extends ClassFactoryImpl {

    /**
     * DefaultConstructor. Creates the object factory for all java base classes.
     */

    public JavaBaseClassFactory() {
        registerClass(Dimension.classnew DimensionObjectDescription());
        registerClass(Dimension2D.classnew Dimension2DObjectDescription());
        registerClass(FloatDimension.classnew BeanObjectDescription(FloatDimension.class));
        registerClass(Date.classnew 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.classnew CharacterObjectDescription());
        registerClass(Boolean.classnew BooleanObjectDescription());
        registerClass(Byte.classnew ByteObjectDescription());
        registerClass(Double.classnew DoubleObjectDescription());
        registerClass(Float.classnew FloatObjectDescription());
        registerClass(Integer.classnew IntegerObjectDescription());
        registerClass(Long.classnew LongObjectDescription());
        registerClass(Short.classnew ShortObjectDescription());
        registerClass(Line2D.classnew Line2DObjectDescription());
        registerClass(Point2D.classnew Point2DObjectDescription());
        registerClass(Rectangle2D.classnew Rectangle2DObjectDescription());
        registerClass(String.classnew StringObjectDescription());
        registerClass(Color.classnew ColorObjectDescription());
        registerClass(BasicStroke.classnew BasicStrokeObjectDescription());
        registerClass(Object.classnew ClassLoaderObjectDescription());

        registerClass(Format.classnew ClassLoaderObjectDescription());
        registerClass(NumberFormat.class, createNumberFormatDescription());
        registerClass(DecimalFormat.classnew DecimalFormatObjectDescription());
        registerClass(DecimalFormatSymbols.class, createDecimalFormatSymbols());
        registerClass(DateFormat.classnew ClassLoaderObjectDescription());
        registerClass(SimpleDateFormat.classnew SimpleDateFormatObjectDescription());
        registerClass(DateFormatSymbols.classnew ClassLoaderObjectDescription());

        registerClass(ArrayList.classnew CollectionObjectDescription(ArrayList.class));
        registerClass(Vector.classnew CollectionObjectDescription(Vector.class));
        registerClass(HashSet.classnew CollectionObjectDescription(HashSet.class));
        registerClass(TreeSet.classnew CollectionObjectDescription(TreeSet.class));
        registerClass(Set.classnew CollectionObjectDescription(HashSet.class));
        registerClass(List.classnew CollectionObjectDescription(ArrayList.class));
        registerClass(Collection.classnew CollectionObjectDescription(ArrayList.class));
    }

    private ObjectDescription createNumberFormatDescription () {
        final BeanObjectDescription nfDesc =
            new BeanObjectDescription(NumberFormat.class, false);
        nfDesc.setParameterDefinition("groupingUsed", Boolean.TYPE);
        nfDesc.setParameterDefinition("maximumFractionDigits", Integer.TYPE);
        nfDesc.setParameterDefinition("minimumFractionDigits", Integer.TYPE);
        nfDesc.setParameterDefinition("maximumIntegerDigits", Integer.TYPE);
        nfDesc.setParameterDefinition("minimumIntegerDigits", Integer.TYPE);
        nfDesc.setParameterDefinition("parseIntegerOnly", Boolean.TYPE);
        return nfDesc;
    }

    private ObjectDescription createDecimalFormatSymbols() {
        final BeanObjectDescription dfsDesc =
            new BeanObjectDescription(DecimalFormatSymbols.class, false);
        dfsDesc.setParameterDefinition("currencySymbol", String.class);
        dfsDesc.setParameterDefinition("decimalSeparator", Character.TYPE);
        dfsDesc.setParameterDefinition("digit", Character.TYPE);
        dfsDesc.setParameterDefinition("groupingSeparator", Character.TYPE);
        dfsDesc.setParameterDefinition("infinity", String.class);
        dfsDesc.setParameterDefinition("internationalCurrencySymbol", String.class);
        dfsDesc.setParameterDefinition("minusSign", Character.TYPE);
        dfsDesc.setParameterDefinition("monetaryDecimalSeparator", Character.TYPE);
        dfsDesc.setParameterDefinition("naN", String.class);
        dfsDesc.setParameterDefinition("patternSeparator", Character.TYPE);
        dfsDesc.setParameterDefinition("perMill", Character.TYPE);
        dfsDesc.setParameterDefinition("percent", Character.TYPE);
        dfsDesc.setParameterDefinition("zeroDigit", Character.TYPE);
        return dfsDesc;

    }
}

File Information:

file name:JavaBaseClassFactory.java
package:org.jfree.xml.factory.objects
qualified name:org.jfree.xml.factory.objects.JavaBaseClassFactory.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/jfree/xml/factory/objects/JavaBaseClassFactory.java
size:7.694 KB (7879 B)
uploaded: 2015-07-22 04:11:10 GMT+0000
last update: 2006-09-26 10:30:36 GMT+0000
last access: 2018-01-22 23:35:29 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2018-01-22 23:35:29 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo