本文整理汇总了Java中org.eclipse.xtend.lib.macro.declaration.MemberDeclaration类的典型用法代码示例。如果您正苦于以下问题:Java MemberDeclaration类的具体用法?Java MemberDeclaration怎么用?Java MemberDeclaration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MemberDeclaration类属于org.eclipse.xtend.lib.macro.declaration包,在下文中一共展示了MemberDeclaration类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDelegatedInterfaces
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public Set<TypeReference> getDelegatedInterfaces(final MemberDeclaration delegate) {
Set<TypeReference> _xblockexpression = null;
{
final Set<TypeReference> interfacesOfDeclaringType = this.getImplementedInterfaces(this.context.newSelfTypeReference(delegate.getDeclaringType()));
final Set<TypeReference> listedInterfaces = this.listedInterfaces(delegate);
final Set<TypeReference> availableInterfaces = this.getImplementedInterfaces(this.getType(delegate));
final Function1<TypeReference, Boolean> _function = new Function1<TypeReference, Boolean>() {
@Override
public Boolean apply(final TypeReference iface) {
return Boolean.valueOf((interfacesOfDeclaringType.contains(iface) && (listedInterfaces.isEmpty() || IterableExtensions.<TypeReference>exists(listedInterfaces, new Function1<TypeReference, Boolean>() {
@Override
public Boolean apply(final TypeReference it) {
return Boolean.valueOf(iface.isAssignableFrom(it));
}
}))));
}
};
_xblockexpression = IterableExtensions.<TypeReference>toSet(IterableExtensions.<TypeReference>filter(availableInterfaces, _function));
}
return _xblockexpression;
}
示例2: hasValidType
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public boolean hasValidType(final MemberDeclaration it) {
boolean _xifexpression = false;
if (((this.getType(it) == null) || this.getType(it).isInferred())) {
boolean _xblockexpression = false;
{
this.context.addError(it, "Cannot use inferred types on delegates");
_xblockexpression = false;
}
_xifexpression = _xblockexpression;
} else {
_xifexpression = true;
}
return _xifexpression;
}
示例3: hasDelegationConflicts
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public boolean hasDelegationConflicts(final MemberDeclaration delegate) {
boolean _xblockexpression = false;
{
boolean conflict = false;
Iterable<? extends MemberDeclaration> _otherDelegates = this.otherDelegates(delegate);
for (final MemberDeclaration other : _otherDelegates) {
{
final Set<TypeReference> otherInterfaces = this.getDelegatedInterfaces(other);
Set<TypeReference> _delegatedInterfaces = this.getDelegatedInterfaces(delegate);
for (final TypeReference iface : _delegatedInterfaces) {
boolean _contains = otherInterfaces.contains(iface);
if (_contains) {
conflict = true;
StringConcatenation _builder = new StringConcatenation();
_builder.append("The interface ");
String _simpleName = iface.getSimpleName();
_builder.append(_simpleName);
_builder.append(" is also implemented by the delegate ");
String _simpleName_1 = other.getSimpleName();
_builder.append(_simpleName_1);
this.context.addError(delegate, _builder.toString());
}
}
}
}
_xblockexpression = conflict;
}
return _xblockexpression;
}
示例4: otherDelegates
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public Iterable<? extends MemberDeclaration> otherDelegates(final MemberDeclaration delegate) {
final Function1<MemberDeclaration, Boolean> _function = new Function1<MemberDeclaration, Boolean>() {
@Override
public Boolean apply(final MemberDeclaration it) {
return Boolean.valueOf((!Objects.equal(it, delegate)));
}
};
return IterableExtensions.filter(this.getDelegates(delegate.getDeclaringType()), _function);
}
示例5: isValidDelegate
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public boolean isValidDelegate(final MemberDeclaration it) {
if (it instanceof MethodDeclaration) {
return _isValidDelegate((MethodDeclaration)it);
} else if (it instanceof FieldDeclaration) {
return _isValidDelegate((FieldDeclaration)it);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(it).toString());
}
}
示例6: getType
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public TypeReference getType(final MemberDeclaration it) {
if (it instanceof MethodDeclaration) {
return _getType((MethodDeclaration)it);
} else if (it instanceof FieldDeclaration) {
return _getType((FieldDeclaration)it);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(it).toString());
}
}
示例7: delegateAccess
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public CharSequence delegateAccess(final MemberDeclaration it, final MethodDeclaration method) {
if (it instanceof MethodDeclaration) {
return _delegateAccess((MethodDeclaration)it, method);
} else if (it instanceof FieldDeclaration) {
return _delegateAccess((FieldDeclaration)it, method);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(it, method).toString());
}
}
示例8: hasExecutable
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public static boolean hasExecutable(final ClassDeclaration cls, final Signature sig) {
Iterable<? extends MemberDeclaration> _declaredMembers = cls.getDeclaredMembers();
Iterable<ExecutableDeclaration> _filter = Iterables.<ExecutableDeclaration>filter(_declaredMembers, ExecutableDeclaration.class);
final Function1<ExecutableDeclaration, Boolean> _function = (ExecutableDeclaration it) -> {
Signature _signature = CommonQueries.signature(it);
return Boolean.valueOf(Objects.equal(_signature, sig));
};
return IterableExtensions.<ExecutableDeclaration>exists(_filter, _function);
}
示例9: isStatic
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public static boolean isStatic(final MemberDeclaration method) {
if (method instanceof MethodDeclaration) {
return _isStatic((MethodDeclaration)method);
} else if (method instanceof FieldDeclaration) {
return _isStatic((FieldDeclaration)method);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(method).toString());
}
}
示例10: propertyType
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public static TypeReference propertyType(final MemberDeclaration method) {
if (method instanceof MethodDeclaration) {
return _propertyType((MethodDeclaration)method);
} else if (method instanceof FieldDeclaration) {
return _propertyType((FieldDeclaration)method);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(method).toString());
}
}
示例11: hasExecutable
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public static boolean hasExecutable(final ClassDeclaration cls, final Signature sig) {
Iterable<? extends MemberDeclaration> _declaredMembers = cls.getDeclaredMembers();
Iterable<ExecutableDeclaration> _filter = Iterables.<ExecutableDeclaration>filter(_declaredMembers, ExecutableDeclaration.class);
final Function1<ExecutableDeclaration,Boolean> _function = new Function1<ExecutableDeclaration,Boolean>() {
public Boolean apply(final ExecutableDeclaration it) {
Signature _signature = ASTExtensions.signature(it);
boolean _equals = Objects.equal(_signature, sig);
return Boolean.valueOf(_equals);
}
};
boolean _exists = IterableExtensions.<ExecutableDeclaration>exists(_filter, _function);
return _exists;
}
示例12: listedInterfaces
import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //导入依赖的package包/类
public Set<TypeReference> listedInterfaces(final MemberDeclaration it) {
return IterableExtensions.<TypeReference>toSet(((Iterable<TypeReference>)Conversions.doWrapArray(it.findAnnotation(this.context.findTypeGlobally(Delegate.class)).getClassArrayValue("value"))));
}