All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.gwt.emul.java.lang.reflect.Char_Field Maven / Gradle / Ivy

The newest version!
package java.lang.reflect;

import com.google.gwt.core.client.JavaScriptObject;

import java.lang.annotation.Annotation;
import java.util.function.Supplier;

/**
 * A field representing a primitive char.
 * 
 * @author "[email protected]"
 * 
 */
public final class Char_Field extends Field {

  public Char_Field(Class declaringClass, String name, int modifiers, 
      JavaScriptObject accessor, Supplier annos) {
    super(char.class, declaringClass, name, modifiers, accessor, annos);
  }

  protected final Object nativeGet(Object obj) {
    return new Character(primitiveGet(obj));
  }

  protected final void nativeSet(Object obj, Object value) {
    primitiveSet(obj, (Character) value);
  }
  
  protected boolean isNotAssignable (Class c) {
    return c != Character.class;
  }

  protected final native char primitiveGet(Object obj)
  /*-{
    return [email protected]::accessor.getter(obj);
   }-*/;

  protected final native void primitiveSet(Object obj, char value)
  /*-{
    [email protected]::accessor.setter(obj, value);
   }-*/;

  protected boolean nullNotAllowed() {
    return true;
  }

  public final char getChar(Object obj) throws IllegalArgumentException,
      IllegalAccessException {
    maybeThrowNull(obj);
    return primitiveGet(obj);
  }

  public final void setChar(Object obj, char c)
      throws IllegalArgumentException, IllegalAccessException {
    maybeThrowNull(obj);
    primitiveSet(obj, c);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy