public static IType[] extractRuntimeTypes( Object... args ) { IType[] runtimeTypes = new IType[args.length]; for( int i = 0; i < args.length; i++ ) { runtimeTypes[i] = TypeSystem.getFromObject( args[i] ); } return runtimeTypes; }
public static IType[] extractRuntimeTypes( Object... args ) { IType[] runtimeTypes = new IType[args.length]; for( int i = 0; i < args.length; i++ ) { runtimeTypes[i] = TypeSystem.getFromObject( args[i] ); } return runtimeTypes; }
public static void setPropertyDynamically(Object rootObject, String propertyName, Object value) { if (rootObject == null) { throw new NullPointerException(); } setProperty(rootObject, TypeSystem.getFromObject(rootObject), propertyName, value); }
@Override public Object getArrayComponent( Object array, int iIndex ) throws IllegalArgumentException, ArrayIndexOutOfBoundsException { IType fromObject = TypeSystem.getFromObject( array ); return fromObject.getArrayComponent( array, iIndex ); }
public static Object getPropertyDynamically(Object rootObject, String propertyName) { if (rootObject == null) { throw new NullPointerException(); } return getProperty(rootObject, TypeSystem.getFromObject(rootObject), propertyName); }
@Override public int getArrayLength( Object array ) throws IllegalArgumentException { IType fromObject = TypeSystem.getFromObject( array ); return fromObject.getArrayLength( array ); }
public RPCEndPoint(IJSchemaRPCType rpcType, Object impl, String rootPath) { _rpcType = rpcType; _impl = impl; _implType = TypeSystem.getFromObject(impl); _rootPath = rootPath; validate(); _methodCache = new HashMap<IType, Map<String, IMethodInfo>>(); return; }
@Override public void setArrayComponent( Object array, int iIndex, Object value ) throws IllegalArgumentException, ArrayIndexOutOfBoundsException { IType fromObject = TypeSystem.getFromObject( array ); fromObject.setArrayComponent( array, iIndex, value ); }
@Override public void setArrayComponent( Object array, int iIndex, Object value ) throws IllegalArgumentException, ArrayIndexOutOfBoundsException { IType fromObject = TypeSystem.getFromObject( array ); fromObject.setArrayComponent( array, iIndex, value ); }
@Override public int getArrayLength( Object array ) throws IllegalArgumentException { IType fromObject = TypeSystem.getFromObject( array ); return fromObject.getArrayLength( array ); }
public static void setPropertyDynamically(Object rootObject, String propertyName, Object value) { if (rootObject == null) { throw new NullPointerException(); } setProperty(rootObject, TypeSystem.getFromObject(rootObject), propertyName, value); }
public static Object getPropertyDynamically(Object rootObject, String propertyName) { if (rootObject == null) { throw new NullPointerException(); } return getProperty(rootObject, TypeSystem.getFromObject(rootObject), propertyName); }
@Override public Object getArrayComponent( Object array, int iIndex ) throws IllegalArgumentException, ArrayIndexOutOfBoundsException { IType fromObject = TypeSystem.getFromObject( array ); return fromObject.getArrayComponent( array, iIndex ); }
public static IType getTypeForTypeVar( Object ref, IType iface, int iIndex ) { IType rtType = TypeSystem.getFromObject( ref ); IType rtIface = TypeSystem.findParameterizedType( rtType, iface ); return rtIface.getTypeParameters()[iIndex]; }
public static IType typeof( Object o ) { IType type = TypeSystem.getFromObject( o ); if( type instanceof IJavaType && type.isGenericType() ) { // Never return a generic type resulting from Java's generic type erasure. // Instead return the "erased" or default type. type = TypeLord.getDefaultParameterizedType( type ); } return type; }
private static IPropertyInfo getPropertyInfo( Object rootObject, IType type, String propertyName ) { IPropertyInfo propertyInfo = ReflectUtil.findProperty( type, propertyName ); if( propertyInfo == null ) { propertyInfo = ReflectUtil.findProperty( TypeSystem.getFromObject( rootObject ), propertyName ); if( propertyInfo == null ) { return null; } } return propertyInfo; }
public static IType typeof( Object o ) { IType type = TypeSystem.getFromObject( o ); if( type instanceof IJavaType && type.isGenericType() ) { // Never return a generic type resulting from Java's generic type erasure. // Instead return the "erased" or default type. type = TypeLord.getDefaultParameterizedType( type ); } return type; }
public static void invokeLockMethod( Object o ) { if( o != null ) { IMethodInfo iMethodInfo = TypeSystem.getFromObject( o ).getTypeInfo().getMethod( "lock" ); if( iMethodInfo != null ) { iMethodInfo.getCallHandler().handleCall( o ); } } }
public static void invokeLockMethod( Object o ) { if( o != null ) { IMethodInfo iMethodInfo = TypeSystem.getFromObject( o ).getTypeInfo().getMethod( "lock" ); if( iMethodInfo != null ) { iMethodInfo.getCallHandler().handleCall( o ); } } }
public static void setProperty( Object instance, String propertyName, Object value ) { IType type = TypeSystem.getFromObject( instance ); IPropertyInfo propertyInfo = findProperty( type, propertyName ); if( propertyInfo != null ) { propertyInfo.getAccessor().setValue( instance, coerce( value, propertyInfo.getFeatureType() ) ); } else { throw new IllegalArgumentException( "Unable to find a property on " + type.getName() + " with name " + propertyName ); } }