Java Code Examples for codemining.languagetools.Scope.ScopeType#SCOPE_CLASS

The following examples show how to use codemining.languagetools.Scope.ScopeType#SCOPE_CLASS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypenameScopeExtractor.java    From api-mining with GNU General Public License v3.0 6 votes vote down vote up
private Multimap<Scope, String> getClassnames(final ASTNode node) {
	final ClassnameFinder cf = new ClassnameFinder(methodsAsRoots);
	node.accept(cf);

	final Multimap<Scope, String> classnames = TreeMultimap.create();

	for (final Entry<ASTNode, String> classname : cf.types.entries()) {
		final ASTNode parentNode = classname.getKey();
		final Scope sc = new Scope(
				classname.getKey().toString(),
				parentNode.getNodeType() == ASTNode.METHOD_DECLARATION ? ScopeType.SCOPE_METHOD
						: ScopeType.SCOPE_CLASS, TYPENAME,
				parentNode.getNodeType(), -1);
		classnames.put(sc, classname.getValue());
	}
	return classnames;
}
 
Example 2
Source File: TypenameScopeExtractor.java    From tassal with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private Multimap<Scope, String> getClassnames(final ASTNode node) {
	final ClassnameFinder cf = new ClassnameFinder(methodsAsRoots);
	node.accept(cf);

	final Multimap<Scope, String> classnames = TreeMultimap.create();

	for (final Entry<ASTNode, String> classname : cf.types.entries()) {
		final ASTNode parentNode = classname.getKey();
		final Scope sc = new Scope(
				classname.getKey().toString(),
				parentNode.getNodeType() == ASTNode.METHOD_DECLARATION ? ScopeType.SCOPE_METHOD
						: ScopeType.SCOPE_CLASS, TYPENAME,
				parentNode.getNodeType(), -1);
		classnames.put(sc, classname.getValue());
	}
	return classnames;
}
 
Example 3
Source File: TypenameScopeExtractor.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private Multimap<Scope, String> getClassnames(final ASTNode node) {
	final ClassnameFinder cf = new ClassnameFinder(methodsAsRoots);
	node.accept(cf);

	final Multimap<Scope, String> classnames = TreeMultimap.create();

	for (final Entry<ASTNode, String> classname : cf.types.entries()) {
		final ASTNode parentNode = classname.getKey();
		final Scope sc = new Scope(
				classname.getKey().toString(),
				parentNode.getNodeType() == ASTNode.METHOD_DECLARATION ? ScopeType.SCOPE_METHOD
						: ScopeType.SCOPE_CLASS, TYPENAME,
				parentNode.getNodeType(), -1);
		classnames.put(sc, classname.getValue());
	}
	return classnames;
}
 
Example 4
Source File: MethodScopeExtractor.java    From api-mining with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean visit(MethodDeclaration node) {
	if (currentMethodNode == null) {
		currentMethodNode = node;
	}
	if (node.isConstructor())
		return super.visit(node);
	final String name = node.getName().toString();

	final Method mth = new Method(name, ScopeType.SCOPE_CLASS);
	if (classNode != null) {
		methods.put(classNode, mth);
	}
	return super.visit(node);
}
 
Example 5
Source File: MethodScopeExtractor.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public boolean visit(MethodDeclaration node) {
	if (currentMethodNode == null) {
		currentMethodNode = node;
	}
	if (node.isConstructor())
		return super.visit(node);
	final String name = node.getName().toString();

	final Method mth = new Method(name, ScopeType.SCOPE_CLASS);
	if (classNode != null) {
		methods.put(classNode, mth);
	}
	return super.visit(node);
}
 
Example 6
Source File: MethodScopeExtractor.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public boolean visit(MethodDeclaration node) {
	if (currentMethodNode == null) {
		currentMethodNode = node;
	}
	if (node.isConstructor())
		return super.visit(node);
	final String name = node.getName().toString();

	final Method mth = new Method(name, ScopeType.SCOPE_CLASS);
	if (classNode != null) {
		methods.put(classNode, mth);
	}
	return super.visit(node);
}