Tabnine Logo
CustomNumberEditor.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.springframework.beans.propertyeditors.CustomNumberEditor

Best Java code snippets using org.springframework.beans.propertyeditors.CustomNumberEditor.getValue (Showing top 9 results out of 315)

origin: spring-projects/spring-framework

/**
 * Format the Number as String, using the specified NumberFormat.
 */
@Override
public String getAsText() {
  Object value = getValue();
  if (value == null) {
    return "";
  }
  if (this.numberFormat != null) {
    // Use NumberFormat for rendering value.
    return this.numberFormat.format(value);
  }
  else {
    // Use toString method for rendering value.
    return value.toString();
  }
}
origin: org.springframework/spring-beans

/**
 * Format the Number as String, using the specified NumberFormat.
 */
@Override
public String getAsText() {
  Object value = getValue();
  if (value == null) {
    return "";
  }
  if (this.numberFormat != null) {
    // Use NumberFormat for rendering value.
    return this.numberFormat.format(value);
  }
  else {
    // Use toString method for rendering value.
    return value.toString();
  }
}
origin: spring-projects/spring-framework

@Test
public void testCustomNumberEditorWithHex() {
  CustomNumberEditor editor = new CustomNumberEditor(Integer.class, false);
  editor.setAsText("0x" + Integer.toHexString(64));
  assertEquals(new Integer(64), editor.getValue());
}
origin: spring-projects/spring-framework

@Test
public void testCustomNumberEditor() {
  CustomNumberEditor editor = new CustomNumberEditor(Integer.class, false);
  editor.setAsText("5");
  assertEquals(new Integer(5), editor.getValue());
  assertEquals("5", editor.getAsText());
  editor.setValue(null);
  assertEquals(null, editor.getValue());
  assertEquals("", editor.getAsText());
}
origin: spring-projects/spring-framework

@Test
public void testCustomNumberEditorWithEmptyAsNull() {
  CustomNumberEditor editor = new CustomNumberEditor(Integer.class, true);
  editor.setAsText("5");
  assertEquals(new Integer(5), editor.getValue());
  assertEquals("5", editor.getAsText());
  editor.setAsText("");
  assertEquals(null, editor.getValue());
  assertEquals("", editor.getAsText());
  editor.setValue(null);
  assertEquals(null, editor.getValue());
  assertEquals("", editor.getAsText());
}
origin: camunda/camunda-bpm-platform

/**
 * Format the Number as String, using the specified NumberFormat.
 */
@Override
public String getAsText() {
  Object value = getValue();
  if (value == null) {
    return "";
  }
  if (this.numberFormat != null) {
    // Use NumberFormat for rendering value.
    return this.numberFormat.format(value);
  }
  else {
    // Use toString method for rendering value.
    return value.toString();
  }
}
origin: springframework/spring-beans

/**
 * Format the Number as String, using the specified NumberFormat.
 */
public String getAsText() {
  Object value = getValue();
  if (value == null) {
    return "";
  }
  if (this.numberFormat != null) {
    // Use NumberFormat for rendering value.
    return this.numberFormat.format(value);
  }
  else {
    // Use toString method for rendering value.
    return value.toString();
  }
}
origin: apache/servicemix-bundles

/**
 * Format the Number as String, using the specified NumberFormat.
 */
@Override
public String getAsText() {
  Object value = getValue();
  if (value == null) {
    return "";
  }
  if (this.numberFormat != null) {
    // Use NumberFormat for rendering value.
    return this.numberFormat.format(value);
  }
  else {
    // Use toString method for rendering value.
    return value.toString();
  }
}
origin: org.objectweb.celtix/celtix-rt

  public Object getValue() {
    Object o = super.getValue();
    if (o instanceof Element) {
      Element el = (Element)o;
      QName type = new QName(el.getNamespaceURI(), el.getLocalName());
      TypeSchema ts = new TypeSchemaHelper(true).get(type.getNamespaceURI());
      if (null == ts) {
        throw new ConfigurationException(new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type));
      }
      try {
        return ts.unmarshal(type, el);
      } catch (JAXBException ex) {
        Message msg = new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type);
        throw new ConfigurationException(msg, ex);
      }
    }

    return o;
  }
}
org.springframework.beans.propertyeditorsCustomNumberEditorgetValue

Popular methods of CustomNumberEditor

  • <init>
    Create a new CustomNumberEditor instance, using the default valueOf methods for parsing and toString
  • setValue
    Coerce a Number value into the required target class, if necessary.
  • getAsText
    Format the Number as String, using the specified NumberFormat.
  • setAsText
    Parse the Number from the given text, using the specified NumberFormat.

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • setContentView (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now