本文整理汇总了Java中org.eclipse.jdt.core.IType.getMethods方法的典型用法代码示例。如果您正苦于以下问题:Java IType.getMethods方法的具体用法?Java IType.getMethods怎么用?Java IType.getMethods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IType
的用法示例。
在下文中一共展示了IType.getMethods方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ClassDetails
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
public ClassDetails(IClassFile classFile, String jarFileName, String packageName, boolean isUserDefined) {
LOGGER.debug("Extracting methods from "+classFile.getElementName());
try {
this.javaDoc=getJavaDoc(classFile);
intialize(classFile,jarFileName,packageName, isUserDefined);
for (IJavaElement iJavaElement : classFile.getChildren()) {
if (iJavaElement instanceof IType) {
IType iType = (IType) iJavaElement;
for (IMethod iMethod : iType.getMethods()) {
addMethodsToClass(iMethod);
}
}
}
} catch (JavaModelException e) {
LOGGER.error("Error occurred while fetching methods from class"+cName);
}
}
示例2: handleType
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
private void handleType(IType type, IFile file, List<ServiceImplementation> serviceImplementations) throws JavaModelException {
/* Parcourt les méthodes. */
for (IMethod method : type.getMethods()) {
/* Filtre pour ne garder que les méthodes publiques d'instance */
if (method.isConstructor() || Flags.isStatic(method.getFlags()) || Flags.isPrivate(method.getFlags())) {
continue;
}
/* Créé le ServiceImplementation. */
String javaName = method.getElementName();
ISourceRange nameRange = method.getNameRange();
FileRegion fileRegion = new FileRegion(file, nameRange.getOffset(), nameRange.getLength());
ServiceImplementation serviceImplementation = new ServiceImplementation(fileRegion, javaName);
serviceImplementations.add(serviceImplementation);
}
}
示例3: handleType
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
private void handleType(IType type, IFile file, List<DaoImplementation> daoImplementations) throws JavaModelException {
/* Parcourt les méthodes. */
for (IMethod method : type.getMethods()) {
/* Filtre pour ne garder que les méthodes publiques d'instance */
if (method.isConstructor() || Flags.isStatic(method.getFlags()) || Flags.isPrivate(method.getFlags())) {
continue;
}
/* Créé le DaoImplementation. */
String javaName = method.getElementName();
ISourceRange nameRange = method.getNameRange();
FileRegion fileRegion = new FileRegion(file, nameRange.getOffset(), nameRange.getLength());
DaoImplementation daoImplementation = new DaoImplementation(fileRegion, javaName);
daoImplementations.add(daoImplementation);
}
}
示例4: handleType
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
private void handleType(IType type, IFile file, List<WsRoute> wsRoutes) {
try {
String pathPrefix = getPathPrefix(type);
/* Parcourt les méthodes du contrôleur de web services. */
for (IMethod method : type.getMethods()) {
handleMethod(method, pathPrefix, file, wsRoutes);
}
} catch (JavaModelException e) {
ErrorUtils.handle(e);
}
}
示例5: parseVertigoDtoFields
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
public static List<DtoField> parseVertigoDtoFields(IType type) {
List<DtoField> fields = new ArrayList<>();
try {
for (IMethod method : type.getMethods()) {
parseVertigoDtoField(method, fields);
}
} catch (JavaModelException e) {
ErrorUtils.handle(e);
}
return fields;
}
示例6: parseKasper5DtoFields
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
public static List<DtoField> parseKasper5DtoFields(IType type) {
List<DtoField> fields = new ArrayList<>();
try {
/* Extraire le type parent */
ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
IType superclass = hierarchy.getSuperclass(type);
for (IMethod method : superclass.getMethods()) {
parseKasper5DtoField(method, fields);
}
} catch (JavaModelException e) {
ErrorUtils.handle(e);
}
return fields;
}
示例7: parseKasper3BeanFields
import org.eclipse.jdt.core.IType; //导入方法依赖的package包/类
private static void parseKasper3BeanFields(IType type, List<DtoField> fields) throws JavaModelException {
/* Extraire le type parent Abstract. */
ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
IType superclass = hierarchy.getSuperclass(type);
for (IMethod method : superclass.getMethods()) {
DtoField field = parseKasper3BeanFieldGetter(method);
if (field != null) {
fields.add(field);
}
}
}