public static MethodList getMethods( ITypeInfo beanInfo, IType whosaskin ) { if( beanInfo instanceof IRelativeTypeInfo && whosaskin != null ) { return ((IRelativeTypeInfo)beanInfo).getMethods( whosaskin ); } else { return beanInfo.getMethods(); } }
public static MethodList getMethods( ITypeInfo beanInfo, IType whosaskin ) { if( beanInfo instanceof IRelativeTypeInfo && whosaskin != null ) { return ((IRelativeTypeInfo)beanInfo).getMethods( whosaskin ); } else { return beanInfo.getMethods(); } }
@Override public MethodList getMethods() { return _superType.getTypeInfo().getMethods(); }
private IMethodInfo findMethodNamed(String method, IType type) { Map<String, IMethodInfo> methodMap = _methodCache.get(type); if(methodMap == null){ methodMap = new HashMap<String, IMethodInfo>(); _methodCache.put(type, methodMap); } IMethodInfo retVal = methodMap.get(method); if(retVal == null){ for (IMethodInfo mi : type.getTypeInfo().getMethods()) { if (mi.getDisplayName().equals(method)) { retVal = mi; break; } } methodMap.put(method, retVal); } return(retVal); }
private List<? extends IMethodInfo> getMethods(ITypeInfo typeInfo) { if (typeInfo instanceof IRelativeTypeInfo) { return ((IRelativeTypeInfo)typeInfo).getMethods(typeInfo.getOwnersType()); } else { return typeInfo.getMethods(); } }
private List<? extends IMethodInfo> getMethods(ITypeInfo typeInfo) { if (typeInfo instanceof IRelativeTypeInfo) { return ((IRelativeTypeInfo)typeInfo).getMethods(typeInfo.getOwnersType()); } else { return typeInfo.getMethods(); } }
public MethodList getMethods() { return JavaTypes.OBJECT().getTypeInfo().getMethods(); }
private IType extractReturnTypeFromInterface( IType target ) { for( IMethodInfo methodInfo : target.getTypeInfo().getMethods() ) { if( methodInfo.getOwnersType().equals( target ) ) { return methodInfo.getReturnType(); } } return null; }
@SuppressWarnings("unchecked") public static String[] extractTestMethods(IType testType) { List<String> methodNames = new ArrayList<String>(); if (testType instanceof IJavaBackedType) { methodNames = extractTestMethods(((IJavaBackedType) testType).getBackingClass()); } else { List<? extends IMethodInfo> methodInfos = testType.getTypeInfo().getMethods(); for (IMethodInfo methodInfo : methodInfos) { if (isTestMethod(methodInfo)) { methodNames.add(methodInfo.getDisplayName()); } } } return methodNames.toArray(new String[methodNames.size()]); }
private String implementIface( IType ifaceType, IType rootType ) { StringBuilder sb = new StringBuilder(); ITypeInfo ti = ifaceType.getTypeInfo(); // Interface properties for( Object o : ti.getProperties() ) { IPropertyInfo pi = (IPropertyInfo)o; genInterfacePropertyDecl( sb, pi, rootType ); } // Interface methods for( Object o : ti.getMethods() ) { IMethodInfo mi = (IMethodInfo)o; genInterfaceMethodDecl( sb, mi, rootType ); } return sb.toString(); }
private static String implementIface( IType ifaceType, IType rootType ) { StringBuilder sb = new StringBuilder(); ITypeInfo ti = ifaceType.getTypeInfo(); // Interface properties for( Object o : ti.getProperties() ) { IPropertyInfo pi = (IPropertyInfo)o; genInterfacePropertyDecl( sb, pi, rootType ); } // Interface methods for( Object o : ti.getMethods() ) { IMethodInfo mi = (IMethodInfo)o; genInterfaceMethodDecl( sb, mi, rootType ); } return sb.toString(); }
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 ); }
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 ); }
public int getTotalNumTestMethods() { List<? extends IMethodInfo> methods = getType().getTypeInfo().getMethods(); int count = 0; for (IMethodInfo method : methods) { if (!method.isStatic() && method.getName().startsWith("test") && method.getParameters().length == 0) { count++; } } return count; }
public WsiServiceInfo( Definitions wsdl, Schema schema, String xsdRootURL, IType webserviceType, Set<IType> exposeEnumAsStringTypes ) { _wsdl = wsdl; _schema = schema; _xsdRootURL = xsdRootURL; _schemas = new ArrayList<XmlSchemaIndex>(); _webserviceType = webserviceType; _exposeEnumAsStringTypes = exposeEnumAsStringTypes; for (IMethodInfo m : _webserviceType.getTypeInfo().getMethods()) { if (m.isPublic() && !m.isStatic()) { for ( IExceptionInfo exceptionInfo : m.getExceptions() ) { _thrownExceptions.add( exceptionInfo.getExceptionType() ); } for ( IType exceptionType : WsiUtilities.EXCEPTIONS_THROWN_BY_INFRASTRUCTURE.get() ) { _thrownExceptions.add( exceptionType ); } } } }
private static boolean hasMethod( IType type, String name ) { if( type.isPrimitive() ) { return false; } ITypeInfo ti = type.getTypeInfo(); if( ti == null ) { return false; } return !ti.getMethods().getMethods( name ).isEmpty(); }
private void loadMetaTypeMethods( Set<IMethodInfo> methods ) { IType type = getOwnersType().getType(); if( type != null ) { Set<IType> allTypes = getTypeInterfaces( getTypeOfType(type), makeTreeSet() ); for( IType t : allTypes ) { for( IMethodInfo pi : t.getTypeInfo().getMethods() ) { if (shouldAddMethod(methods, pi)) { methods.add( new MetaMethodInfoDelegate( this, pi ) ); } } } } }
private void loadMetaTypeMethods( Set<IMethodInfo> methods ) { IType type = getOwnersType().getType(); if( type != null ) { Set<IType> allTypes = getTypeInterfaces( getTypeOfType(type), makeTreeSet() ); for( IType t : allTypes ) { for( IMethodInfo pi : t.getTypeInfo().getMethods() ) { if (shouldAddMethod(methods, pi)) { methods.add( new MetaMethodInfoDelegate( this, pi ) ); } } } } }
protected void mergeMethods(List<IMethodInfo> methods, IType type, boolean replace) { List<? extends IMethodInfo> methodInfos; if (type != null && !TypeSystem.isDeleted(type)) { if (type.getTypeInfo() instanceof IRelativeTypeInfo) { methodInfos = ((IRelativeTypeInfo) type.getTypeInfo()).getMethods( _typeInfo.getOwnersType()); } else { methodInfos = type.getTypeInfo().getMethods(); } for (IMethodInfo methodInfo : methodInfos) { mergeMethod(methods, methodInfo, replace); } } }
protected void mergeMethods(MethodList methods, IType type, boolean replace) { List<? extends IMethodInfo> methodInfos; if (type != null && !TypeSystem.isDeleted(type)) { if (type.getTypeInfo() instanceof IRelativeTypeInfo) { methodInfos = ((IRelativeTypeInfo) type.getTypeInfo()).getMethods( _typeInfo.getOwnersType()); } else { methodInfos = type.getTypeInfo().getMethods(); } for (IMethodInfo methodInfo : methodInfos) { if( !type.isInterface() || !methodInfo.isStatic() ) { // static interface methods are not inherited mergeMethod(methods, methodInfo, replace); } } } }