public char getReflectC() throws Exception { return f_c.getChar(t); }
/** * Gets the value of a static <code>char</code> field. * * @param field Field object whose value is returned. * @return the value of the <code>char</code> field */ public static char getChar(Field field) { checkStatic(field); try { return field.getChar(null); } catch (Exception exp) { throw translate(exp); } }
/** * Gets the value of an instance <code>char</code> field. * * @param field Field object whose value is returned. * @param obj the object to extract the <code>char</code> value * from * @return the value of the <code>char</code> field */ public static char getChar(Field field, Object obj) { try { return field.getChar(obj); } catch (Exception exp) { throw translate(exp); } }
public char getChar(Object o) throws IllegalArgumentException, IllegalAccessException { return this.field.getChar(o); }
public final int getCharValue(Object obj) throws IllegalAccessException { if (!isAndroid && memOffset >= 0) { return FSTUtil.unFlaggedUnsafe.getChar(obj, memOffset); } return field.getChar(obj); }
public static char callSetChar(Field thiz, Object obj) throws IllegalArgumentException, IllegalAccessException { thiz.setChar(obj, 'Y'); return thiz.getChar(obj); }
public final int getCharValue(Object obj) throws IllegalAccessException { if (!isAndroid && memOffset >= 0) { return FSTUtil.unFlaggedUnsafe.getChar(obj, memOffset); } return field.getChar(obj); }
rep.append(joiner).append(name).append('=').append(val); } else if (type.equals(char.class)) { char val = ff.getChar(this); rep.append(joiner).append(name).append('=').append(val); } else if (type.equals(Long.class)) {
private void writeField(Field f, Object obj) { Class type = f.getType(); try { if (type.isPrimitive()) { String name = encodeTagName(f.getName()); String value; if (type == Character.TYPE) { value = encodeText(f.getChar(obj)); } else { value = f.get(obj).toString(); } out.print("<"); out.print(name); out.print(">"); out.print(value); out.print("</"); out.print(name); writeln('>'); } else { write(f.getName(), f.get(obj)); } } catch (RuntimeException re) { throw re; } catch (Exception exp) { throw new RuntimeException(exp); } }
return Character.valueOf( field.getChar( owner ) );
/** * Returns the value of the field in the specified object as a {@code char}. * This reproduces the effect of {@code object.fieldName} * <p> * If this field is static, the object argument is ignored. * Otherwise, if the object is {@code null}, a NullPointerException is * thrown. If the object is not an instance of the declaring class of the * method, an IllegalArgumentException is thrown. * <p> * If this Field object is enforcing access control (see AccessibleObject) * and this field is not accessible from the current context, an * IllegalAccessException is thrown. * * @param object * the object to access * @return the field value * @throws NullPointerException * if the object is {@code null} and the field is non-static * @throws IllegalArgumentException * if the object is not compatible with the declaring class * @throws IllegalAccessException * if this field is not accessible */ public char getChar(Object object) throws IllegalAccessException, IllegalArgumentException { checkAccess(object, false); checkReceiver(object); return getChar(object, getType(), Character.TYPE); }
output.writeByte(field.getByte(obj)); } else if (type == char.class) { output.writeChar(field.getChar(obj)); } else if (type == double.class) { output.writeDouble(field.getDouble(obj));
@Override public char getChar( Object obj ) { try { return field.getChar( obj ); } catch ( Exception e ) { analyzeError( e, obj ); return 0; } }
@Override public char getChar( Object obj ) { try { return field.getChar( obj ); } catch ( Exception e ) { analyzeError( e, obj ); return 0; } }
@Override void writePrimitiveField(Object o, EntityOutput output, Field field) throws IllegalAccessException { output.writeChar(field.getChar(o)); } }
public boolean reflecCharBranch() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { Field field = HasClinit.class.getDeclaredField("SOME_CHAR_VALUE"); char charValue = field.getChar(null); if (charValue!='c') { return false; } else { return true; } }
public void copy (Object original, Object copy) { try { field.setChar(copy, field.getChar(original)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } } }
public void write (Output output, Object object) { try { output.writeChar(field.getChar(object)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } }
public void copy (Object original, Object copy) { try { field.setChar(copy, field.getChar(original)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } } }