package com.usesoft.highcharts4gwt.generator.codemodel.field;

import javax.annotation.CheckForNull;

import com.sun.codemodel.JCodeModel;
import com.sun.codemodel.JDefinedClass;
import com.usesoft.highcharts4gwt.generator.codemodel.OutputTypeVisitor;

public class FieldNumberWriter extends FieldWriter implements OutputTypeVisitor<Void, Void>
{
    private final String defaultValue;

    public FieldNumberWriter(JCodeModel codeModel, JDefinedClass jClass, String className, String defaultValue, boolean pipe, String fieldName)
    {
        super(codeModel, className, jClass, pipe, fieldName);
        this.defaultValue = defaultValue;
    }

    @Override
    @CheckForNull
    public Void visitInterface(Void in)
    {
        InterfaceFieldHelper.addGetterSetterDeclaration(getNames(), Number.class, getJclass());
        return null;
    }

    @Override
    @CheckForNull
    public Void visitJso(Void in)
    {
        JsoFieldHelper.writeGetterNativeCodeNumber(getNames(), Number.class, getJclass(), getCodeModel(), defaultValue);
        JsoFieldHelper.writeSetterNativeCode(getNames(), Number.class, getJclass(), getCodeModel());
        return null;
    }

    @Override
    @CheckForNull
    public Void visitMock(Void in)
    {
        MockFieldHelper.addGetterSetterDeclaration(getNames(), Number.class, getJclass());
        return null;
    }

    @Override
    protected String getNameExtension()
    {
        return "AsNumber";
    }

}

@@ -779,38 +779,38 @@
 ion(getNames(), 
-Number
+double
 .class, getJclas
@@ -970,38 +970,38 @@
 ber(getNames(), 
-Number
+double
 .class, getJclas
@@ -1085,38 +1085,38 @@
 ode(getNames(), 
-Number
+double
 .class, getJclas
@@ -1301,22 +1301,22 @@
 ames(), 
-Number
+double
 .class, 

replace number by double