本文整理汇总了Java中org.aikodi.chameleon.core.reference.CrossReferenceWithName类的典型用法代码示例。如果您正苦于以下问题:Java CrossReferenceWithName类的具体用法?Java CrossReferenceWithName怎么用?Java CrossReferenceWithName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CrossReferenceWithName类属于org.aikodi.chameleon.core.reference包,在下文中一共展示了CrossReferenceWithName类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renameConstructorCalls
import org.aikodi.chameleon.core.reference.CrossReferenceWithName; //导入依赖的package包/类
protected void renameConstructorCalls(Document target) {
target.apply(CrossReferenceWithName.class, c -> {
CrossReferenceWithName origin = (CrossReferenceWithName) c.origin();
if (origin != c.origin()) {
Declaration element;
try {
element = origin.getElement();
if (element.isTrue(java(element).CONSTRUCTOR)) {
c.setName(implementationName((Type) element));
}
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
});
}
示例2: box
import org.aikodi.chameleon.core.reference.CrossReferenceWithName; //导入依赖的package包/类
public JavaTypeReference box(JavaTypeReference aRef, Namespace root) throws LookupException {
String newFqn = _boxMap.get(((CrossReferenceWithName)aRef).name());
if(newFqn == null) {
//throw new LookupException("Type "+fqn+" cannot be converted through boxing.");
return aRef;
}
JavaTypeReference result = createTypeReference(newFqn);
result.setUniParent(root);
return result;
}