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


Java Signature類代碼示例

本文整理匯總了Java中org.aikodi.chameleon.core.declaration.Signature的典型用法代碼示例。如果您正苦於以下問題:Java Signature類的具體用法?Java Signature怎麽用?Java Signature使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Signature類屬於org.aikodi.chameleon.core.declaration包,在下文中一共展示了Signature類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: selector

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public DeclarationSelector<Declaration> selector() {
		return new TwoPhaseDeclarationSelector<Declaration>() {

//			@Override
//			public WeakPartialOrder<Member> order() {
//				return new SelectorWithoutOrder.EqualityOrder<Member>();
//			}
			
			@Override
			protected void applyOrder(List<SelectionResult<Declaration>> tmp) throws LookupException {
				
			}

			@Override
			public boolean selectedBasedOnName(Signature signature) throws LookupException {
				return signature.name().equals(name());
			}

			@Override
			public Class<Declaration> selectedClass() {
				return Declaration.class;
			}

			@Override
			public boolean selectedRegardlessOfName(Declaration declaration) throws LookupException {
				ObjectOrientedLanguage language = (ObjectOrientedLanguage) declaration.language(ObjectOrientedLanguage.class);
				return declaration.is(language.CLASS) == Ternary.TRUE;
			}

			@Override
			public String selectionName(DeclarationContainer container) throws LookupException {
				return name();
			}
			
		};
	}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:37,代碼來源:SingleStaticImport.java

示例2: oldNameFor

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public QualifiedName oldNameFor(Signature signature) throws LookupException {
	QualifiedName result = null;
	if(newSignature().sameAs(signature)) {
		result = oldFQN();
	}
	return result;
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:8,代碼來源:AbstractClause.java

示例3: oldDeclaration

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public Declaration oldDeclaration() throws LookupException {
	Declaration container = nearestAncestor(Subobject.class).componentType();
	List<Signature> signatures = oldFQN().signatures();
	Declaration result = null;
	int size = signatures.size();
	for(int i = 0; i< size; i++) {
		final Signature sig = signatures.get(i);
		DeclarationSelector<Declaration> selector = new NameSelector<Declaration>(Declaration.class) {
			@Override
			protected boolean correctSignature(Declaration declaration)
					throws LookupException {
				return declaration.signature().sameAs(sig);
			}
			public String name() {
				return sig.name();
			}
		};
		DeclarationCollector<Declaration> collector = new DeclarationCollector<Declaration>(selector);
		if(i < size - 1) {
			container.targetContext().lookUp(collector);
			container = collector.result();
		} else {// i = size - 1, after which the iteration stops.
			container.targetContext().lookUp(collector);
			result = collector.result();
		}
	}
	if(result != null) {
	  return result;
	} else {
		throw new LookupException("The old declaration of "+ newSignature().name()+" cannot be found.");
	}
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:33,代碼來源:AbstractClause.java

示例4: setSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public void setSignature(Signature signature) {
	if(signature instanceof SimpleNameSignature || signature == null) {
		set(_signature,(SimpleNameSignature)signature);
	} else {
		throw new ChameleonProgrammerException("Setting wrong type of signature. Provided: "+(signature == null ? null :signature.getClass().getName())+" Expected SimpleNameSignature");
	}
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:8,代碼來源:Subobject.java

示例5: selectedBasedOnName

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
private boolean selectedBasedOnName(Signature signature) throws LookupException {
  	boolean result = false;
	if(signature instanceof SignatureWithParameters) {
		List<Type> actuals = getActualParameterTypes();
		List<Type> formals = ((SignatureWithParameters)signature).parameterTypes();
		if (MoreSpecificTypesOrder.create().contains(actuals, formals)) {
				result = true;
		}
	}
    return result;
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:12,代碼來源:SubobjectConstructorCall.java

示例6: correctSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public boolean correctSignature(Signature signature) throws LookupException {
	return true;
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:5,代碼來源:AbstractConstructorSelector.java

示例7: correctSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public boolean correctSignature(Signature signature) throws LookupException {
	return signature.name().equals(invocation().name());
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:4,代碼來源:JavaMethodSelector.java

示例8: setSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public void setSignature(Signature signature) {
	throw new ChameleonProgrammerException();
}
 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:5,代碼來源:AbstractAnonymousInnerClass.java

示例9: setNewSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public void setNewSignature(Signature signature) {
  set(_signature, signature);
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:4,代碼來源:AbstractClause.java

示例10: Overrides

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public Overrides(Signature newSignature, QualifiedName oldFqn) {
	setNewSignature(newSignature);
	setOldFqn(oldFqn);
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:5,代碼來源:Overrides.java

示例11: signature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public Signature signature() {
  return _signature.getOtherEnd();
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:5,代碼來源:TypeMemberDeclarator.java

示例12: setSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public void setSignature(Signature signature) {
  set(_signature, signature);
}
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:5,代碼來源:TypeMemberDeclarator.java

示例13: oldNameFor

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
/**
 * Return the inverse mapping of the given signature. It does not matter whether or not the member of the
 * super class is actually inherited or not. If the configuration clause does not map signatures, or if the
 * given signature does not match the mapping, then null is returned.
 */
public abstract QualifiedName oldNameFor(Signature signature) throws LookupException;
 
開發者ID:markovandooren,項目名稱:jlo,代碼行數:7,代碼來源:ConfigurationClause.java

示例14: correctSignature

import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public abstract boolean correctSignature(Signature signature) throws LookupException; 
開發者ID:markovandooren,項目名稱:jnome,代碼行數:2,代碼來源:AbstractJavaMethodSelector.java


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