jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/PropertySetterBase.java
changeset 23782 953bfc3fbe31
parent 22679 d785acd84a14
equal deleted inserted replaced
23403:85dbdc227c5e 23782:953bfc3fbe31
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.xml.internal.ws.spi.db;
    26 package com.sun.xml.internal.ws.spi.db;
    27 
    27 
       
    28 import java.util.HashMap;
       
    29 import java.util.Map;
       
    30 
    28 /**
    31 /**
    29  * This is the Setter of a bean property.
    32  * This is the Setter of a bean property.
    30  * @author shih-chang.chen@oracle.com
    33  * @author shih-chang.chen@oracle.com
    31  * @exclude
    34  * @exclude
    32  */
    35  */
    42                 method.getName().length() > 3 &&
    45                 method.getName().length() > 3 &&
    43                 method.getReturnType().equals(void.class) &&
    46                 method.getReturnType().equals(void.class) &&
    44                 method.getParameterTypes() != null &&
    47                 method.getParameterTypes() != null &&
    45                 method.getParameterTypes().length == 1);
    48                 method.getParameterTypes().length == 1);
    46     }
    49     }
       
    50 
       
    51     /**
       
    52      * Uninitialized map keyed by their classes.
       
    53      */
       
    54     private static final Map<Class, Object> uninitializedValues = new HashMap<Class, Object>();
       
    55     static {
       
    56         uninitializedValues.put(byte.class, Byte.valueOf((byte) 0));
       
    57         uninitializedValues.put(boolean.class, false);
       
    58         uninitializedValues.put(char.class, Character.valueOf((char) 0));
       
    59         uninitializedValues.put(float.class, Float.valueOf(0));
       
    60         uninitializedValues.put(double.class, Double.valueOf(0));
       
    61         uninitializedValues.put(int.class, Integer.valueOf(0));
       
    62         uninitializedValues.put(long.class, Long.valueOf(0));
       
    63         uninitializedValues.put(short.class, Short.valueOf((short) 0));
       
    64     }
       
    65     static protected Object uninitializedValue(Class cls) { return uninitializedValues.get(cls); }
    47 }
    66 }