本文整理汇总了Java中org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration类的典型用法代码示例。如果您正苦于以下问题:Java ParameterDeclaration类的具体用法?Java ParameterDeclaration怎么用?Java ParameterDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterDeclaration类属于org.eclipse.xtend.lib.macro.declaration包,在下文中一共展示了ParameterDeclaration类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cacheFieldName
import org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration; //导入依赖的package包/类
/**
* This allows you to get the name of the cache field that will be generated for a cached method.
* This way you can write your own active annotations that add additional features for cached methods.
*/
public static String cacheFieldName(final MethodDeclaration method) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("_cache_");
String _simpleName = method.getSimpleName();
_builder.append(_simpleName, "");
{
Iterable<? extends ParameterDeclaration> _parameters = method.getParameters();
boolean _isEmpty = IterableExtensions.isEmpty(_parameters);
boolean _not = (!_isEmpty);
if (_not) {
_builder.append("_");
Iterable<? extends ParameterDeclaration> _parameters_1 = method.getParameters();
final Function1<ParameterDeclaration, CharSequence> _function = (ParameterDeclaration it) -> {
return CachedProcessor.fieldFriendlyName(it);
};
String _join = IterableExtensions.join(_parameters_1, "_", _function);
_builder.append(_join, "");
}
}
return _builder.toString();
}
示例2: signature
import org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration; //导入依赖的package包/类
public static Signature signature(final ExecutableDeclaration it) {
String _simpleName = it.getSimpleName();
Iterable<? extends ParameterDeclaration> _parameters = it.getParameters();
final Function1<ParameterDeclaration, TypeReference> _function = (ParameterDeclaration p) -> {
return p.getType();
};
Iterable<TypeReference> _map = IterableExtensions.map(_parameters, _function);
return CommonQueries.signature(_simpleName, ((TypeReference[])Conversions.unwrapArray(_map, TypeReference.class)));
}
示例3: signature
import org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration; //导入依赖的package包/类
public static Signature signature(final ExecutableDeclaration it) {
String _simpleName = it.getSimpleName();
List<? extends ParameterDeclaration> _parameters = it.getParameters();
final Function1<ParameterDeclaration,TypeReference> _function = new Function1<ParameterDeclaration,TypeReference>() {
public TypeReference apply(final ParameterDeclaration p) {
TypeReference _type = p.getType();
return _type;
}
};
List<TypeReference> _map = ListExtensions.map(_parameters, _function);
Signature _signature = ASTExtensions.signature(_simpleName, ((TypeReference[])Conversions.unwrapArray(_map, TypeReference.class)));
return _signature;
}
示例4: fieldFriendlyName
import org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration; //导入依赖的package包/类
private static String fieldFriendlyName(final ParameterDeclaration it) {
TypeReference _type = it.getType();
Type _type_1 = _type.getType();
String _qualifiedName = _type_1.getQualifiedName();
return _qualifiedName.replaceAll("\\.", "_");
}