private void resolveRequestTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo requestTransformAnnotation = type.getTypeInfo().getAnnotation( _requestTransformType ); if ( requestTransformAnnotation != null ) { Object instance = requestTransformAnnotation.getInstance(); webservice._requestTransform = (Function1) _requestTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
private static IConstructorInfo findCallableConstructor( IType type, IType[] runtimeTypes ) { ITypeInfo typeInfo = type.getTypeInfo(); List<? extends IConstructorInfo> constructors = typeInfo instanceof IRelativeTypeInfo ? ((IRelativeTypeInfo)typeInfo).getConstructors( type ) : typeInfo.getConstructors(); return ITypeInfo.FIND.callableConstructor( constructors, runtimeTypes ); }
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 IMethodInfo findCallableMethod( String methodName, IType[] runtimeTypes, IType type ) { ITypeInfo typeInfo = type.getTypeInfo(); MethodList methodInfos = typeInfo instanceof IRelativeTypeInfo ? ((IRelativeTypeInfo)typeInfo).getMethods( type ) : typeInfo.getMethods(); return ITypeInfo.FIND.callableMethod( methodInfos, methodName, runtimeTypes ); }
private boolean isCompilable( IType type ) { IType doNotVerifyAnnotation = TypeSystem.getByFullNameIfValid( "gw.testharness.DoNotVerifyResource" ); return type instanceof IGosuClass && !type.getTypeInfo().hasAnnotation( doNotVerifyAnnotation ); }
static IPropertyInfo getPropertyInfo( IType rootType, String propName ) { ITypeInfo typeInfo = rootType.getTypeInfo(); if( typeInfo instanceof IRelativeTypeInfo ) { return ((IRelativeTypeInfo)typeInfo).getProperty( rootType, propName ); } else { return typeInfo.getProperty( propName ); } }
static IMethodInfo getMethodInfo( IType rootType, String funcName, IType[] params ) { ITypeInfo typeInfo = rootType.getTypeInfo(); if( typeInfo instanceof IRelativeTypeInfo ) { return ((IRelativeTypeInfo)typeInfo).getMethod( rootType, funcName, params ); } else { return typeInfo.getMethod( funcName, params ); } }
public static String getMethodSignature( IMethodInfo mi ) { IFunctionType type = TypeSystem.getOrCreateFunctionType( mi ); return mi.getDisplayName() + getParameterDisplay( mi ) + " : " + getTypeName( type.getReturnType() ); }
public Object handleCall( Object ctx, Object... args ) { return getSource().getCallHandler().handleCall( ctx, args ); } }
private PropertyNameMap<T> convertToMap(List<IPropertyInfo> features) { PropertyNameMap<T> ret = new PropertyNameMap(); for (IPropertyInfo feature : features) { ret.put(convertCharSequenceToCorrectSensitivity(feature.getName()), feature); } ret.freeze(); return ret; }
@Override public IAnnotationInfo getAnnotation( IType type ) { return ANNOTATION_HELPER.getAnnotation(type, getAnnotations(), type.getName()); }
private IType useDynamicTypeIfDynamicRoot( IInvocableType funcType, IType ctxType ) { if( funcType instanceof FunctionType && ((FunctionType)funcType).getMethodInfo() != null ) { IMethodInfo mi = ((FunctionType)funcType).getMethodInfo(); if( mi.getOwnersType().isDynamic() ) { ctxType = ((FunctionType)funcType).getReturnType(); } } return ctxType; }
protected Set<? extends IType> loadAllTypesInHierarchy() { Set<IType> allTypes; if( isArray() ) { allTypes = getArrayVersionsOfEachType( getComponentType().getAllTypesInHierarchy() ); } else { allTypes = getAllClassesInClassHierarchyAsIntrinsicTypes( TypeSystem.getOrCreateTypeReference( this ) ); } return allTypes; }
public void setValue( Object ctx, Object value ) { getSource().getAccessor().setValue( ctx, value ); } }
private void resolveResponseXmlTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo xmlTransformAnnotation = type.getTypeInfo().getAnnotation( _responseXmlTransformType ); if ( xmlTransformAnnotation != null ) { Object instance = xmlTransformAnnotation.getInstance(); webservice._responseXmlTransform = (Function1) _responseXmlTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
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 IPropertyInfo findProperty( IType type, String propertyName ) { ITypeInfo typeInfo = type.getTypeInfo(); return typeInfo instanceof IRelativeTypeInfo ? ((IRelativeTypeInfo)typeInfo).getProperty( type, propertyName ) : typeInfo.getProperty( propertyName ); }
static IMethodInfo getMethodInfo( IType rootType, String funcName, IType[] params ) { ITypeInfo typeInfo = rootType.getTypeInfo(); if( typeInfo instanceof IRelativeTypeInfo ) { return ((IRelativeTypeInfo)typeInfo).getMethod( rootType, funcName, params ); } else { return typeInfo.getMethod( funcName, params ); } }
private void resolveResponseTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo responseTransformAnnotation = type.getTypeInfo().getAnnotation( _responseTransformType ); if ( responseTransformAnnotation != null ) { Object instance = responseTransformAnnotation.getInstance(); webservice._responseTransform = (Function1) _responseTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
private void resolveRequestXmlTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo xmlTransformAnnotation = type.getTypeInfo().getAnnotation( _requestXmlTransformType ); if ( xmlTransformAnnotation != null ) { Object instance = xmlTransformAnnotation.getInstance(); webservice._requestXmlTransform = (Function1) _requestXmlTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }