• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClassDeclaration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.xtend.lib.macro.declaration.ClassDeclaration的典型用法代码示例。如果您正苦于以下问题:Java ClassDeclaration类的具体用法?Java ClassDeclaration怎么用?Java ClassDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClassDeclaration类属于org.eclipse.xtend.lib.macro.declaration包,在下文中一共展示了ClassDeclaration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: hasSuperEquals

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public boolean hasSuperEquals(final ClassDeclaration cls) {
  boolean _xblockexpression = false;
  {
    Type _type = cls.getExtendedClass().getType();
    final ClassDeclaration superClass = ((ClassDeclaration) _type);
    boolean _xifexpression = false;
    boolean _equals = this.context.newTypeReference(superClass).equals(this.context.getObject());
    if (_equals) {
      _xifexpression = false;
    } else {
      boolean _xifexpression_1 = false;
      boolean _hasEquals = this.hasEquals(superClass);
      if (_hasEquals) {
        _xifexpression_1 = true;
      } else {
        _xifexpression_1 = this.hasSuperEquals(superClass);
      }
      _xifexpression = _xifexpression_1;
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:24,代码来源:EqualsHashCodeProcessor.java


示例2: hasSuperHashCode

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public boolean hasSuperHashCode(final ClassDeclaration cls) {
  boolean _xblockexpression = false;
  {
    Type _type = cls.getExtendedClass().getType();
    final ClassDeclaration superClass = ((ClassDeclaration) _type);
    boolean _xifexpression = false;
    boolean _equals = this.context.newTypeReference(superClass).equals(this.context.getObject());
    if (_equals) {
      _xifexpression = false;
    } else {
      boolean _xifexpression_1 = false;
      boolean _hasHashCode = this.hasHashCode(superClass);
      if (_hasHashCode) {
        _xifexpression_1 = true;
      } else {
        _xifexpression_1 = this.hasSuperHashCode(superClass);
      }
      _xifexpression = _xifexpression_1;
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:24,代码来源:EqualsHashCodeProcessor.java


示例3: simpleInterfaceName

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public String simpleInterfaceName(final ClassDeclaration cls) {
  String _xblockexpression = null;
  {
    final String simpleName = cls.getSimpleName();
    String _xifexpression = null;
    boolean _startsWith = simpleName.startsWith("Default");
    if (_startsWith) {
      _xifexpression = simpleName.substring(7);
    } else {
      String _xifexpression_1 = null;
      boolean _endsWith = simpleName.endsWith("Impl");
      if (_endsWith) {
        int _length = simpleName.length();
        int _minus = (_length - 4);
        _xifexpression_1 = simpleName.substring(0, _minus);
      } else {
        throw new IllegalArgumentException(
          "Class name must start with \'Default\' or end with \'Impl\'");
      }
      _xifexpression = _xifexpression_1;
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
 
开发者ID:East196,项目名称:maker,代码行数:26,代码来源:ExtractInterfaceProcessor.java


示例4: persistentState

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
/**
 * All non-static, non-transient fields of this class
 */
public static Iterable<? extends FieldDeclaration> persistentState(final ClassDeclaration cls) {
  Iterable<? extends FieldDeclaration> _declaredFields = cls.getDeclaredFields();
  final Function1<FieldDeclaration,Boolean> _function = new Function1<FieldDeclaration,Boolean>() {
    public Boolean apply(final FieldDeclaration it) {
      boolean _and = false;
      boolean _isTransient = it.isTransient();
      boolean _not = (!_isTransient);
      if (!_not) {
        _and = false;
      } else {
        boolean _isStatic = it.isStatic();
        boolean _not_1 = (!_isStatic);
        _and = (_not && _not_1);
      }
      return Boolean.valueOf(_and);
    }
  };
  Iterable<? extends FieldDeclaration> _filter = IterableExtensions.filter(_declaredFields, _function);
  return _filter;
}
 
开发者ID:damien-cremilleux,项目名称:TP4INFO,代码行数:24,代码来源:ASTExtensions.java


示例5: newWildCardSelfTypeReference

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
private TypeReference newWildCardSelfTypeReference(final ClassDeclaration cls) {
  final Function1<TypeParameterDeclaration, TypeReference> _function = new Function1<TypeParameterDeclaration, TypeReference>() {
    @Override
    public TypeReference apply(final TypeParameterDeclaration it) {
      return Util.this.context.newWildcardTypeReference(Util.this.context.getObject());
    }
  };
  return this.context.newTypeReference(cls, ((TypeReference[])Conversions.unwrapArray(IterableExtensions.map(cls.getTypeParameters(), _function), TypeReference.class)));
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:10,代码来源:EqualsHashCodeProcessor.java


示例6: getSuperConstructor

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public ResolvedConstructor getSuperConstructor(final TypeDeclaration it) {
  if ((it instanceof ClassDeclaration)) {
    if ((Objects.equal(((ClassDeclaration)it).getExtendedClass(), this.context.getObject()) || (((ClassDeclaration)it).getExtendedClass() == null))) {
      return null;
    }
    return IterableExtensions.head(((ClassDeclaration)it).getExtendedClass().getDeclaredResolvedConstructors());
  } else {
    return null;
  }
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:11,代码来源:FinalFieldsConstructorProcessor.java


示例7: getToStringConfig

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public ToStringConfiguration getToStringConfig(final ClassDeclaration it) {
  ToStringConfiguration _xblockexpression = null;
  {
    final AnnotationReference anno = it.findAnnotation(this.context.findTypeGlobally(ToString.class));
    ToStringConfiguration _xifexpression = null;
    if ((anno == null)) {
      _xifexpression = null;
    } else {
      _xifexpression = new ToStringConfiguration(anno);
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:15,代码来源:ToStringProcessor.java


示例8: getAdapterClassName

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public String getAdapterClassName(final ClassDeclaration declaration) {
  String _qualifiedName = declaration.getQualifiedName();
  String _plus = (_qualifiedName + ".");
  String _simpleName = declaration.getSimpleName();
  String _plus_1 = (_plus + _simpleName);
  return (_plus_1 + "Adapter");
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:8,代码来源:EmfAdaptableProcessor.java


示例9: hasExecutable

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的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);
}
 
开发者ID:East196,项目名称:maker,代码行数:10,代码来源:CommonQueries.java


示例10: hasDataConstructor

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static boolean hasDataConstructor(final ClassDeclaration cls) {
  Iterable<? extends FieldDeclaration> _persistentState = CommonQueries.persistentState(cls);
  final Function1<FieldDeclaration, TypeReference> _function = (FieldDeclaration it) -> {
    return it.getType();
  };
  Iterable<TypeReference> _map = IterableExtensions.map(_persistentState, _function);
  Signature _constructorSignature = CommonQueries.constructorSignature(cls, ((TypeReference[])Conversions.unwrapArray(_map, TypeReference.class)));
  return CommonQueries.hasExecutable(cls, _constructorSignature);
}
 
开发者ID:East196,项目名称:maker,代码行数:10,代码来源:CommonQueries.java


示例11: hasEquals

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static boolean hasEquals(final ClassDeclaration cls) {
  Iterable<? extends MethodDeclaration> _declaredMethods = cls.getDeclaredMethods();
  final Function1<MethodDeclaration, Boolean> _function = (MethodDeclaration it) -> {
    return Boolean.valueOf(((Objects.equal(it.getSimpleName(), "equals") && (IterableExtensions.size(it.getParameters()) == 1)) && 
      Objects.equal(IterableExtensions.head(it.getParameters()).getType().getName(), "java.lang.Object")));
  };
  return IterableExtensions.exists(_declaredMethods, _function);
}
 
开发者ID:East196,项目名称:maker,代码行数:9,代码来源:CommonQueries.java


示例12: hasGetter

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static boolean hasGetter(final FieldDeclaration field) {
  TypeDeclaration _declaringType = field.getDeclaringType();
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("get");
  String _simpleName = field.getSimpleName();
  String _firstUpper = StringExtensions.toFirstUpper(_simpleName);
  _builder.append(_firstUpper, "");
  Signature _signature = CommonQueries.signature(_builder.toString());
  return CommonQueries.hasExecutable(((ClassDeclaration) _declaringType), _signature);
}
 
开发者ID:East196,项目名称:maker,代码行数:11,代码来源:CommonQueries.java


示例13: hasSetter

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static boolean hasSetter(final FieldDeclaration field) {
  TypeDeclaration _declaringType = field.getDeclaringType();
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("set");
  String _simpleName = field.getSimpleName();
  String _firstUpper = StringExtensions.toFirstUpper(_simpleName);
  _builder.append(_firstUpper, "");
  TypeReference _type = field.getType();
  Signature _signature = CommonQueries.signature(_builder.toString(), _type);
  return CommonQueries.hasExecutable(((ClassDeclaration) _declaringType), _signature);
}
 
开发者ID:East196,项目名称:maker,代码行数:12,代码来源:CommonQueries.java


示例14: persistentState

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
/**
 * All non-static, non-transient fields of this class
 */
public static Iterable<? extends FieldDeclaration> persistentState(final ClassDeclaration cls) {
  Iterable<? extends FieldDeclaration> _declaredFields = cls.getDeclaredFields();
  final Function1<FieldDeclaration, Boolean> _function = (FieldDeclaration it) -> {
    return Boolean.valueOf(((!it.isTransient()) && (!it.isStatic())));
  };
  return IterableExtensions.filter(_declaredFields, _function);
}
 
开发者ID:East196,项目名称:maker,代码行数:11,代码来源:CommonQueries.java


示例15: packageName

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static String packageName(final ClassDeclaration cls) {
  String _xblockexpression = null;
  {
    String _qualifiedName = cls.getQualifiedName();
    final String[] parts = _qualifiedName.split("\\.");
    int _size = ((List<String>)Conversions.doWrapArray(parts)).size();
    int _minus = (_size - 1);
    Iterable<String> _take = IterableExtensions.<String>take(((Iterable<String>)Conversions.doWrapArray(parts)), _minus);
    _xblockexpression = IterableExtensions.join(_take, ".");
  }
  return _xblockexpression;
}
 
开发者ID:East196,项目名称:maker,代码行数:13,代码来源:CommonQueries.java


示例16: qualifiedInterfaceName

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public String qualifiedInterfaceName(final ClassDeclaration cls) {
  StringConcatenation _builder = new StringConcatenation();
  String _packageName = CommonQueries.packageName(cls);
  _builder.append(_packageName, "");
  _builder.append(".");
  String _simpleInterfaceName = this.simpleInterfaceName(cls);
  _builder.append(_simpleInterfaceName, "");
  return _builder.toString();
}
 
开发者ID:East196,项目名称:maker,代码行数:10,代码来源:ExtractInterfaceProcessor.java


示例17: hasExecutable

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的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;
}
 
开发者ID:damien-cremilleux,项目名称:TP4INFO,代码行数:14,代码来源:ASTExtensions.java


示例18: hasDataConstructor

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static boolean hasDataConstructor(final ClassDeclaration cls) {
  Iterable<? extends FieldDeclaration> _persistentState = ASTExtensions.persistentState(cls);
  final Function1<FieldDeclaration,TypeReference> _function = new Function1<FieldDeclaration,TypeReference>() {
    public TypeReference apply(final FieldDeclaration it) {
      TypeReference _type = it.getType();
      return _type;
    }
  };
  Iterable<TypeReference> _map = IterableExtensions.map(_persistentState, _function);
  Signature _constructorSignature = ASTExtensions.constructorSignature(cls, ((TypeReference[])Conversions.unwrapArray(_map, TypeReference.class)));
  boolean _hasExecutable = ASTExtensions.hasExecutable(cls, _constructorSignature);
  return _hasExecutable;
}
 
开发者ID:damien-cremilleux,项目名称:TP4INFO,代码行数:14,代码来源:ASTExtensions.java


示例19: packageName

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public static String packageName(final ClassDeclaration cls) {
  String _xblockexpression = null;
  {
    String _qualifiedName = cls.getQualifiedName();
    final String[] parts = _qualifiedName.split("\\.");
    int _size = ((List<String>)Conversions.doWrapArray(parts)).size();
    int _minus = (_size - 1);
    Iterable<String> _take = IterableExtensions.<String>take(((Iterable<String>)Conversions.doWrapArray(parts)), _minus);
    String _join = IterableExtensions.join(_take, ".");
    _xblockexpression = (_join);
  }
  return _xblockexpression;
}
 
开发者ID:damien-cremilleux,项目名称:TP4INFO,代码行数:14,代码来源:ASTExtensions.java


示例20: qualifiedInterfaceName

import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration; //导入依赖的package包/类
public String qualifiedInterfaceName(final ClassDeclaration cls) {
  StringConcatenation _builder = new StringConcatenation();
  String _packageName = ASTExtensions.packageName(cls);
  _builder.append(_packageName, "");
  _builder.append(".");
  String _simpleInterfaceName = this.simpleInterfaceName(cls);
  _builder.append(_simpleInterfaceName, "");
  return _builder.toString();
}
 
开发者ID:damien-cremilleux,项目名称:TP4INFO,代码行数:10,代码来源:ExtractInterfaceProcessor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SmarterJmolAdapter类代码示例发布时间:2022-05-22
下一篇:
Java AlterableContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap