当前位置: 首页>>代码示例>>Java>>正文


Java ParameterDeclaration类代码示例

本文整理汇总了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();
}
 
开发者ID:East196,项目名称:maker,代码行数:26,代码来源:CachedProcessor.java

示例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)));
}
 
开发者ID:East196,项目名称:maker,代码行数:10,代码来源:CommonQueries.java

示例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;
}
 
开发者ID:damien-cremilleux,项目名称:TP4INFO,代码行数:14,代码来源:ASTExtensions.java

示例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("\\.", "_");
}
 
开发者ID:East196,项目名称:maker,代码行数:7,代码来源:CachedProcessor.java


注:本文中的org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。