本文整理汇总了Java中org.eclipse.xtend.lib.macro.declaration.Type类的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Type类属于org.eclipse.xtend.lib.macro.declaration包,在下文中一共展示了Type类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hasSuperEquals
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的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.Type; //导入依赖的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: getLeftType
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public TypeReference getLeftType(final TypeReference typeReference) {
final Type type = typeReference.getType();
Type _type = this.eitherType.getType();
boolean _tripleEquals = (type == _type);
if (_tripleEquals) {
return IterableExtensions.<TypeReference>head(typeReference.getActualTypeArguments());
}
if ((type instanceof InterfaceDeclaration)) {
final Function1<TypeReference, TypeReference> _function = (TypeReference it) -> {
return this.getLeftType(it);
};
return IterableExtensions.<TypeReference>head(IterableExtensions.<TypeReference>filterNull(IterableExtensions.map(((InterfaceDeclaration)type).getExtendedInterfaces(), _function)));
}
return null;
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:16,代码来源:JsonRpcDataTransformationContext.java
示例4: getRightType
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public TypeReference getRightType(final TypeReference typeReference) {
final Type type = typeReference.getType();
Type _type = this.eitherType.getType();
boolean _tripleEquals = (type == _type);
if (_tripleEquals) {
return IterableExtensions.<TypeReference>last(typeReference.getActualTypeArguments());
}
if ((type instanceof InterfaceDeclaration)) {
final Function1<TypeReference, TypeReference> _function = (TypeReference it) -> {
return this.getRightType(it);
};
return IterableExtensions.<TypeReference>head(IterableExtensions.<TypeReference>filterNull(IterableExtensions.map(((InterfaceDeclaration)type).getExtendedInterfaces(), _function)));
}
return null;
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:16,代码来源:JsonRpcDataTransformationContext.java
示例5: newSelfTypeReference
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public TypeReference newSelfTypeReference(final Type typeDeclaration) {
return this.delegate.newSelfTypeReference(typeDeclaration);
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:4,代码来源:JsonRpcDataTransformationContext.java
示例6: newTypeReference
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public TypeReference newTypeReference(final Type typeDeclaration, final TypeReference... typeArguments) {
return this.delegate.newTypeReference(typeDeclaration, typeArguments);
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:4,代码来源:JsonRpcDataTransformationContext.java
示例7: findTypeGlobally
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public Type findTypeGlobally(final Class<?> clazz) {
return this.delegate.findTypeGlobally(clazz);
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:4,代码来源:JsonRpcDataTransformationContext.java
示例8: newAnnotationReference
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public AnnotationReference newAnnotationReference(final Type annotationTypeDelcaration) {
return this.delegate.newAnnotationReference(annotationTypeDelcaration);
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:4,代码来源:JsonRpcDataTransformationContext.java
示例9: generateToString
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
protected MutableMethodDeclaration generateToString(final MutableClassDeclaration impl, @Extension final TransformationContext context) {
MutableMethodDeclaration _xblockexpression = null;
{
final ArrayList<FieldDeclaration> toStringFields = CollectionLiterals.<FieldDeclaration>newArrayList();
ClassDeclaration c = impl;
do {
{
Iterable<? extends FieldDeclaration> _declaredFields = c.getDeclaredFields();
Iterables.<FieldDeclaration>addAll(toStringFields, _declaredFields);
TypeReference _extendedClass = c.getExtendedClass();
Type _type = null;
if (_extendedClass!=null) {
_type=_extendedClass.getType();
}
c = ((ClassDeclaration) _type);
}
} while(((c != null) && (!Objects.equal(c, context.getObject()))));
final Procedure1<MutableMethodDeclaration> _function = (MutableMethodDeclaration it) -> {
it.setReturnType(context.getString());
it.addAnnotation(context.newAnnotationReference(Override.class));
it.addAnnotation(context.newAnnotationReference(Pure.class));
final AccessorsProcessor.Util accessorsUtil = new AccessorsProcessor.Util(context);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append(ToStringBuilder.class);
_builder.append(" b = new ");
_builder.append(ToStringBuilder.class);
_builder.append("(this);");
_builder.newLineIfNotEmpty();
{
for(final FieldDeclaration field : toStringFields) {
_builder.append("b.add(\"");
String _simpleName = field.getSimpleName();
_builder.append(_simpleName);
_builder.append("\", ");
{
TypeDeclaration _declaringType = field.getDeclaringType();
boolean _equals = Objects.equal(_declaringType, impl);
if (_equals) {
_builder.append("this.");
String _simpleName_1 = field.getSimpleName();
_builder.append(_simpleName_1);
} else {
String _getterName = accessorsUtil.getGetterName(field);
_builder.append(_getterName);
_builder.append("()");
}
}
_builder.append(");");
_builder.newLineIfNotEmpty();
}
}
_builder.append("return b.toString();");
_builder.newLine();
}
};
it.setBody(_client);
};
_xblockexpression = impl.addMethod("toString", _function);
}
return _xblockexpression;
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:64,代码来源:JsonRpcDataProcessor.java
示例10: fieldFriendlyName
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的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
示例11: cacheAnnotation
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
protected final AnnotationReference cacheAnnotation() {
Type _findTypeGlobally = this.context.findTypeGlobally(Cached.class);
return this.method.findAnnotation(_findTypeGlobally);
}
开发者ID:East196,项目名称:maker,代码行数:5,代码来源:ParametrizedMethodMemoizer.java
示例12: getAccessorsAnnotation
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
public AnnotationReference getAccessorsAnnotation(final AnnotationTarget it) {
final Type _findTypeGlobally = this.context.findTypeGlobally(DirtyAccessors.class);
return it.findAnnotation(_findTypeGlobally);
}
开发者ID:CymricNPG,项目名称:abattle,代码行数:5,代码来源:DirtyAccessorsProcessor.java
示例13: newTypeReference
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
/**
* Creates a new type reference for the given typeDeclaration and the type arguments.
*
* @param typeDeclaration the type to point to
* @param typeArguments the type arguments
* @return a {@link TypeReference} pointing to the given type.
*/
TypeReference newTypeReference(Type typeDeclaration, TypeReference... typeArguments);
开发者ID:eclipse,项目名称:xtext-lib,代码行数:9,代码来源:TypeReferenceProvider.java
示例14: newSelfTypeReference
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
/**
* Returns a new self type reference for the given typeDeclaration, e.g. if you have a class like
*
* <pre>
* class Foo<T> {}
* </pre>
*
* And you want to add a method that returns the instance itself, you would use the self type as the method's return type.
*
* <pre>
* class Foo<T> {
* def Foo<T> mySelf() {
* this
* }
* }
* </pre>
*
* In contrast, {@link #newTypeReference(Type, TypeReference...)} without any arguments would return the raw type only and would result in code with warnings:
* <pre>
* class Foo<T> {
* def Foo mySelf() {
* this
* }
* }
* </pre>
*
* @param typeDeclaration the raw type for the newly produced reference
* @return a reference to the given type declaration
* @since 2.7
*/
TypeReference newSelfTypeReference(Type typeDeclaration);
开发者ID:eclipse,项目名称:xtext-lib,代码行数:32,代码来源:TypeReferenceProvider.java
示例15: findUpstreamType
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
/**
* @param clazz
* the clazz representing the type to look up
* @return the type with the same qualified name as the given
* <code>Class</code> object, or <code>null</code> if that type
* couldn't be found on the compilation unit's upstream dependencies.
*/
Type findUpstreamType(Class<?> clazz);
开发者ID:eclipse,项目名称:xtext-lib,代码行数:9,代码来源:UpstreamTypeLookup.java
示例16: newAnnotationReference
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
/**
* Creates a new annotation reference for the given type declaration.
*
* @param annotationTypeDelcaration the annotation type to point to, must not be <code>null</code>.
* @return a {@link AnnotationReference} pointing to the given type, or <code>null</code> if the given type is not an annotation type.
* @throws IllegalArgumentException if the given type declaration is null
*/
AnnotationReference newAnnotationReference(Type annotationTypeDelcaration);
开发者ID:eclipse,项目名称:xtext-lib,代码行数:9,代码来源:AnnotationReferenceProvider.java
示例17: findTypeGlobally
import org.eclipse.xtend.lib.macro.declaration.Type; //导入依赖的package包/类
/**
* @param clazz
* the clazz representing the type to look up
* @return the type with the same qualified name as the given
* <code>Class</code> object, or <code>null</code> if that type
* couldn't be found on the compilation units classpath.
*/
Type findTypeGlobally(Class<?> clazz);
开发者ID:eclipse,项目名称:xtext-lib,代码行数:9,代码来源:GlobalTypeLookup.java
注:本文中的org.eclipse.xtend.lib.macro.declaration.Type类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论