本文整理匯總了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();
}
};
}
示例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;
}
示例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.");
}
}
示例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");
}
}
示例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;
}
示例6: correctSignature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public boolean correctSignature(Signature signature) throws LookupException {
return true;
}
示例7: correctSignature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public boolean correctSignature(Signature signature) throws LookupException {
return signature.name().equals(invocation().name());
}
示例8: setSignature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public void setSignature(Signature signature) {
throw new ChameleonProgrammerException();
}
示例9: setNewSignature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public void setNewSignature(Signature signature) {
set(_signature, signature);
}
示例10: Overrides
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public Overrides(Signature newSignature, QualifiedName oldFqn) {
setNewSignature(newSignature);
setOldFqn(oldFqn);
}
示例11: signature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public Signature signature() {
return _signature.getOtherEnd();
}
示例12: setSignature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
@Override
public void setSignature(Signature signature) {
set(_signature, signature);
}
示例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;
示例14: correctSignature
import org.aikodi.chameleon.core.declaration.Signature; //導入依賴的package包/類
public abstract boolean correctSignature(Signature signature) throws LookupException;