當前位置: 首頁>>代碼示例>>Java>>正文


Java LookupException.printStackTrace方法代碼示例

本文整理匯總了Java中org.aikodi.chameleon.core.lookup.LookupException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java LookupException.printStackTrace方法的具體用法?Java LookupException.printStackTrace怎麽用?Java LookupException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.aikodi.chameleon.core.lookup.LookupException的用法示例。


在下文中一共展示了LookupException.printStackTrace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: erasure

import org.aikodi.chameleon.core.lookup.LookupException; //導入方法依賴的package包/類
@Override
public Type erasure() {
	Element el = farthestOrigin();
	if(el != this) {
		return ((JavaType)el).erasure();
	}
	// I am not sure whether this is correct. The memberInheritanceRelations are not erased in RawType.
	Type outmostType = lexical().farthestAncestor(Type.class);
	if(outmostType == null) {
		outmostType = this;
	}
	RawType outer;
	if(outmostType instanceof RawType) {
		outer = (RawType) outmostType;
	} else {
		outer = new RawType(outmostType);
	}
	RawType current = outer;
	List<Type> outerTypes = ancestors(Type.class);
	outerTypes.add(0, this);

	int size = outerTypes.size();
	Factory expressionFactory = language(ObjectOrientedLanguage.class).plugin(Factory.class);
	for(int i = size - 2; i>=0;i--) {
		NameReference<RawType> simpleRef = expressionFactory.createNameReference(outerTypes.get(i).name(), RawType.class);
		simpleRef.setUniParent(current);
		try {
			current = simpleRef.getElement();
		} catch (LookupException e) {
			e.printStackTrace();
			throw new ChameleonProgrammerException("An inner type of a newly created outer raw type cannot be found",e);
		}
	}
	return current;	
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:36,代碼來源:SubobjectType.java

示例2: addInfixOperators

import org.aikodi.chameleon.core.lookup.LookupException; //導入方法依賴的package包/類
protected void addInfixOperators() {
	try {
		JavaView view = _view;
		Type obj = findType(view, "java.lang.Object");
		view.setTopLevelType(obj);
		if (obj != null) {
			addInfixOperator(obj, "boolean", equality(), "Object");
			addInfixOperator(obj, "boolean", "!=", "Object");
			addPlusString(obj);
		}
		Type string = findType(view, "java.lang.String");
		if (string != null) {
			addInfixOperator(string, "String", "+", "Object");
			addInfixOperator(string, "String", "+=", "Object");
			addInfixOperator(string, "String", "+", "byte");
			addInfixOperator(string, "String", "+=", "byte");
			addInfixOperator(string, "String", "+", "short");
			addInfixOperator(string, "String", "+=", "short");
			addInfixOperator(string, "String", "+", "char");
			addInfixOperator(string, "String", "+=", "char");
			addInfixOperator(string, "String", "+", "int");
			addInfixOperator(string, "String", "+=", "int");
			addInfixOperator(string, "String", "+", "long");
			addInfixOperator(string, "String", "+=", "long");
			addInfixOperator(string, "String", "+", "float");
			addInfixOperator(string, "String", "+=", "float");
			addInfixOperator(string, "String", "+", "double");
			addInfixOperator(string, "String", "+=", "double");
			addInfixOperator(string, "String", "+", "boolean");
			addInfixOperator(string, "String", "+=", "boolean");
		}
		copyOperators(findType(view, "int"), findType(view, "java.lang.Integer"));
		copyOperators(findType(view, "long"), findType(view, "java.lang.Long"));
		copyOperators(findType(view, "float"), findType(view, "java.lang.Float"));
		copyOperators(findType(view, "double"), findType(view, "java.lang.Double"));
		copyOperators(findType(view, "boolean"), findType(view, "java.lang.Boolean"));
		copyOperators(findType(view, "short"), findType(view, "java.lang.Boolean"));
		copyOperators(findType(view, "byte"), findType(view, "java.lang.Byte"));
		copyOperators(findType(view, "char"), findType(view, "java.lang.Character"));

	}
	catch (LookupException e) {
		// This should only happen if the Java system library was not parsed.
		e.printStackTrace();
		throw new ChameleonProgrammerException(e);
	}
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:48,代碼來源:PredefinedElementsFactory.java

示例3: erasure

import org.aikodi.chameleon.core.lookup.LookupException; //導入方法依賴的package包/類
@Override
	public Type erasure() {
		// FIXME this code seems to have been duplicated a number of times.
		Java7 language = language(Java7.class);
		Type result = _rawTypeCache;
		if (result == null) {
			if (is(language.INSTANCE) == Ternary.TRUE) {
				Type outmostType = lexical().farthestAncestor(Type.class);
				Type outer;
				if (outmostType == null) {
//					outmostType = this;
//					if(nbTypeParameters(TypeParameter.class) > 0) {
					  outer = new RawType(this);
//					} else {
//						outer = this;
//					}
				} else {
					if (outmostType instanceof RawType) {
						outer = (RawType) outmostType;
					} else {
						outer = ((JavaType)outmostType).erasure();
					}
				}
				Type current = outer;
				List<Type> outerTypes = ancestors(Type.class);
				outerTypes.add(0, this);

				int size = outerTypes.size();
				Factory expressionFactory = language.plugin(Factory.class);
				for (int i = size - 2; i >= 0; i--) {
					NameReference<Type> simpleRef = expressionFactory.createNameReference(outerTypes.get(i).name(),
							(Class) Type.class);
					simpleRef.setUniParent(current);
					try {
						current = simpleRef.getElement();
					} catch (LookupException e) {
						e.printStackTrace();
						throw new ChameleonProgrammerException("An inner type of a newly created outer raw type cannot be found", e);
					}
				}
				result = current;
			} else {
				// static
				if(nbTypeParameters(TypeParameter.class) > 0) {
				  result = new RawType(this);
				} else {
					result = this;
				}
			}
			_rawTypeCache = result;
		}
		return result;
	}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:54,代碼來源:RegularJavaType.java


注:本文中的org.aikodi.chameleon.core.lookup.LookupException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。