예제 #1
0
 /**
  * Returns the String necessary to convert an Object to an instance of this XSType. This method is
  * really only useful for primitive types
  *
  * @param variableName the name of the Object
  * @return the String necessary to convert an Object to an instance of this XSType
  */
 public String createFromJavaObjectCode(String variableName) {
   StringBuffer sb = new StringBuffer("((java.lang.Float)");
   sb.append(variableName);
   sb.append(")");
   if (!_asWrapper) {
     sb.append(".floatValue()");
   }
   return sb.toString();
 } // -- fromJavaObject
예제 #2
0
 /**
  * Returns the String necessary to convert an instance of this XSType to an Object. This method is
  * really only useful for primitive types
  *
  * @param variableName the name of the instance variable
  * @return the String necessary to convert an instance of this XSType to an Object
  */
 public String createToJavaObjectCode(String variableName) {
   if (_asWrapper) return super.createToJavaObjectCode(variableName);
   else {
     StringBuffer sb = new StringBuffer("new java.lang.Float(");
     sb.append(variableName);
     sb.append(")");
     return sb.toString();
   }
 } // -- toJavaObject
예제 #3
0
 /**
  * Returns the String necessary to convert an instance of this XSType
  * to an Object. This method is really only useful for primitive types
  * @param variableName the name of the instance variable
  * @return the String necessary to convert an instance of this XSType
  * to an Object
 **/
 public String createToJavaObjectCode(String variableName) {
     if (SourceGenerator.usePrimitiveWrapper())
         return super.createToJavaObjectCode(variableName);
     else {
         StringBuffer sb = new StringBuffer("new Short(");
         sb.append(variableName);
         sb.append(")");
         return sb.toString();
     }
 } //-- toJavaObject
예제 #4
0
 /**
  * Returns the String necessary to convert an Object to
  * an instance of this XSType. This method is really only useful
  * for primitive types
  * @param variableName the name of the Object
  * @return the String necessary to convert an Object to an
  * instance of this XSType
 **/
 public String createFromJavaObjectCode(String variableName) {
      StringBuffer sb = new StringBuffer("((Short)");
      sb.append(variableName);
      sb.append(").shortValue()");
      return sb.toString();
 } //-- fromJavaObject