当前位置: 首页>>代码示例>>Java>>正文


Java JavaPackage类代码示例

本文整理汇总了Java中com.thoughtworks.qdox.model.JavaPackage的典型用法代码示例。如果您正苦于以下问题:Java JavaPackage类的具体用法?Java JavaPackage怎么用?Java JavaPackage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JavaPackage类属于com.thoughtworks.qdox.model包,在下文中一共展示了JavaPackage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
@Override
public Object visit(FieldRef fieldRef) {
	try {
		return super.visit(fieldRef);
	} catch (IllegalArgumentException iae) {
		// let's try again! (some refs are not found unfortunately ...)
		JavaPackage currentPackage = context.getPackage();
		JavaClass targetClass = null;
		for (JavaClass c : currentPackage.getClasses()) {
			if (c.getName().equals(fieldRef.getNamePart(0))) {
				targetClass = c;
			}
		}

		if (targetClass == null) throw iae;

		JavaField field = targetClass.getFieldByName(fieldRef.getNamePart(1));
		return getFieldReferenceValue(field);
	}
}
 
开发者ID:Maddoc42,项目名称:JaxRs2Retrofit,代码行数:21,代码来源:SimpleEvaluatingVisitor.java

示例2: printAll

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
private void printAll(JavaProjectBuilder builder) {
	for (JavaPackage p : builder.getPackages()) {
		if (!p.getName().startsWith(CONTEXT_PREFIX)) {
			continue;
		}
		final TourStep step = getQuickDevTourStep(p);
		if (step != null) {
			// process(p);
		}
	}
	for (JavaClass c : builder.getClasses()) {
		if (!c.getPackageName().startsWith(CONTEXT_PREFIX)) {
			continue;
		}
		process(c);
	}

}
 
开发者ID:cyriux,项目名称:livingdocumentation-workshop,代码行数:19,代码来源:LivingGuidedTourTest.java

示例3: usecase

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
@Test
public void usecase() {
    JavaProjectBuilder builder = new JavaProjectBuilder();
    // Adding all .java files in a source tree (recursively).
    builder.addSourceTree(new File("/Users/Arnauld/Projects/cucumber-contrib/src/test/java/sample/coffeemachine"));

    for(JavaPackage pkg : builder.getPackages()) {
        System.out.println("::: " + pkg.getName());
        for(JavaClass klazz : pkg.getClasses()) {
            System.out.println(" :: " + klazz);
            for(JavaMethod method : klazz.getMethods()) {
                System.out.println("  : " + method.getAnnotations());
            }
        }
    }
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:17,代码来源:GrammarGenTest.java

示例4: main

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
public static void main(String[] args) {
        JavaProjectBuilder builder = new JavaProjectBuilder();
        try {
            JavaSource src = builder.addSource(new File(
                    "/Users/bingoohuang/github/java-sandbox/src/main/java/org/n3r/sandbox/qdox/DemoJava.java"));
            JavaPackage pkg = src.getPackage();
            String name = pkg.getName();
            String toString = pkg.toString();
            JavaPackage parent = pkg.getParentPackage();
            Collection<JavaClass> classes = pkg.getClasses();
            List<JavaMethod> methods = classes.iterator().next().getMethods();
            for (JavaMethod method : methods) {
                System.out.println("Method Name : " + method.getName());
            }
            System.out.println("pkg name : " + name);
            System.out.println("pkg to String : " + toString);
            System.out.println("pkg parent name : " + parent);

//            Method Name : printName
//            Method Name : createListOfNames
//            pkg name : org.n3r.sandbox.qdox
//            pkg to String : package org.n3r.sandbox.qdox
//            pkg parent name : null
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
开发者ID:bingoohuang,项目名称:javacode-demo,代码行数:28,代码来源:QDoxDemo.java

示例5: printAll

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
private void printAll(JavaProjectBuilder builder) {
	final Map<JavaPackage, JavaAnnotation> inventory = boundedContextInventory(builder);
	for (Entry<JavaPackage, JavaAnnotation> entry : inventory.entrySet()) {
		final JavaPackage pckge = entry.getKey();
		final JavaAnnotation bc = entry.getValue();
		printOneBoundedContext(pckge, bc);
	}
}
 
开发者ID:cyriux,项目名称:livingdocumentation-workshop,代码行数:9,代码来源:LivingGlossaryTest.java

示例6: boundedContextInventory

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
/**
 * Creates an inventory of every package that defines a Bounded Context
 */
private static Map<JavaPackage, JavaAnnotation> boundedContextInventory(JavaProjectBuilder builder) {
	final Map<JavaPackage, JavaAnnotation> contexts = new HashMap<JavaPackage, JavaAnnotation>();
	for (JavaPackage p : builder.getPackages()) {
		final JavaAnnotation boundedContext = boundedContextAnnotation(p);
		if (boundedContext != null) {
			contexts.put(p, boundedContext);
		}
	}
	return contexts;
}
 
开发者ID:cyriux,项目名称:livingdocumentation-workshop,代码行数:14,代码来源:LivingGlossaryTest.java

示例7: boundedContextAnnotation

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
/**
 * Extracts the Bounded Context Annotation of the given package, or null if
 * there's none
 */
private static JavaAnnotation boundedContextAnnotation(JavaPackage pkge) {
	for (JavaAnnotation annotation : pkge.getAnnotations()) {
		final JavaClass type = annotation.getType();
		if (type.getFullyQualifiedName().endsWith("BoundedContext")) {
			return annotation;
		}
	}
	return null;
}
 
开发者ID:cyriux,项目名称:livingdocumentation-workshop,代码行数:14,代码来源:LivingGlossaryTest.java

示例8: printOneBoundedContext

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
private void printOneBoundedContext(final JavaPackage pckge, final JavaAnnotation bc) {
	if (pckge.getName().startsWith(CONTEXT_PREFIX)) {
		return;
	}
	printContextDetails(pckge, bc);
	for (JavaClass clss : pckge.getClasses()) {
		if (isBusinessMeaningful(clss)) {
			process(clss);
		}
	}
}
 
开发者ID:cyriux,项目名称:livingdocumentation-workshop,代码行数:12,代码来源:LivingGlossaryTest.java

示例9: printContextDetails

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
private void printContextDetails(JavaPackage pckge, JavaAnnotation bc) {
	println();
	final String bcName = (String) bc.getNamedParameter("name");
	writer.println("## " + bcName.trim().replaceAll("\"", ""));
	println();
	printComment(pckge.getComment());
	final Object link = bc.getNamedParameter("link");
	if (link != null) {
		println();
		printListItem("See: " + link);
	}
	println();
}
 
开发者ID:cyriux,项目名称:livingdocumentation-workshop,代码行数:14,代码来源:LivingGlossaryTest.java

示例10: exitingPackage

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
@Override
public void exitingPackage(JavaPackage pkg) {
    packagesParsed++;
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:5,代码来源:GrammarParserStatisticsListener.java

示例11: enteringPackage

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
@Override
public void enteringPackage(JavaPackage pkg) {
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:4,代码来源:GrammarParserListenerAdapter.java

示例12: exitingPackage

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
@Override
public void exitingPackage(JavaPackage pkg) {
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:4,代码来源:GrammarParserListenerAdapter.java

示例13: getPkg

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
/**
 * @return the pkg
 */
public JavaPackage getPkg() {
    return pkg;
}
 
开发者ID:jcrcano,项目名称:DrakkarKeel,代码行数:7,代码来源:JavaParser.java

示例14: setPkg

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
/**
 * @param pkg the pkg to set
 */
public void setPkg(JavaPackage pkg) {
    this.pkg = pkg;
}
 
开发者ID:jcrcano,项目名称:DrakkarKeel,代码行数:7,代码来源:JavaParser.java

示例15: enteringPackage

import com.thoughtworks.qdox.model.JavaPackage; //导入依赖的package包/类
void enteringPackage(JavaPackage pkg); 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:2,代码来源:GrammarParserListener.java


注:本文中的com.thoughtworks.qdox.model.JavaPackage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。