Codota Logo
Converter
Code IndexAdd Codota to your IDE (free)

How to use
Converter
in
com.mysema.converters

Best Java code snippets using com.mysema.converters.Converter (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: com.mysema.converters/converters

public void register(Converter<?> converter){
  converters.put(converter.getJavaType(), converter);
}
origin: com.mysema.rdf/rdfbean-core

@Override
@SuppressWarnings("unchecked")
public <T> T fromString(String value, Class<T> requiredType) {
  if (requiredType.equals(String.class)) {
    return (T) value;
  }
  Converter<T> converter = (Converter<T>) classToConverter.get(requiredType);
  if (converter != null) {
    return converter.fromString(value);
  } else {
    throw new IllegalArgumentException("No conversion for " + requiredType.getName() + " available");
  }
}
origin: com.mysema.rdf/rdfbean-core

@Override
@SuppressWarnings("unchecked")
public <T> String toString(T javaValue) {
  if (javaValue instanceof String) {
    return (String) javaValue;
  }
  Converter<T> converter = (Converter<T>) classToConverter.get(javaValue.getClass());
  if (converter != null) {
    return converter.toString(javaValue);
  } else {
    throw new IllegalArgumentException("No conversion for " + javaValue.getClass().getName() + " available");
  }
}
origin: com.mysema.rdf/rdfbean-core

private <T> void register(UID type, Converter<T> converter) {
  register(type, converter.getJavaType());
  classToConverter.put(converter.getJavaType(), converter);
  Class<?> primitiveType = Primitives.unwrap(converter.getJavaType());
  if (!primitiveType.equals(converter.getJavaType())) {
    register(type, primitiveType);
    classToConverter.put(primitiveType, converter);
  }
}
com.mysema.convertersConverter

Most used methods

  • getJavaType
  • fromString
  • toString

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • orElseThrow (Optional)
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now