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

Java TypeIds类代码示例

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

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



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

示例1: generateCleanMethod

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
private MethodDeclaration generateCleanMethod(List<BuilderFieldData> builderFields, EclipseNode builderType, ASTNode source) {
	List<Statement> statements = new ArrayList<Statement>();
	
	for (BuilderFieldData bfd : builderFields) {
		if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) {
			bfd.singularData.getSingularizer().appendCleaningCode(bfd.singularData, builderType, statements);
		}
	}
	
	FieldReference thisUnclean = new FieldReference(CLEAN_FIELD_NAME, 0);
	thisUnclean.receiver = new ThisReference(0, 0);
	statements.add(new Assignment(thisUnclean, new FalseLiteral(0, 0), 0));
	MethodDeclaration decl = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult);
	decl.selector = CLEAN_METHOD_NAME;
	decl.modifiers = ClassFileConstants.AccPrivate;
	decl.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
	decl.returnType = TypeReference.baseTypeReference(TypeIds.T_void, 0);
	decl.statements = statements.toArray(new Statement[0]);
	decl.traverse(new SetGeneratedByVisitor(source), (ClassScope) null);
	return decl;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:22,代码来源:HandleBuilder.java


示例2: longToIntForHashCode

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
/** Give 2 clones! */
public Expression longToIntForHashCode(Expression ref1, Expression ref2, ASTNode source) {
	int pS = source.sourceStart, pE = source.sourceEnd;
	/* (int)(ref >>> 32 ^ ref) */
	IntLiteral int32 = makeIntLiteral("32".toCharArray(), source);
	BinaryExpression higherBits = new BinaryExpression(ref1, int32, OperatorIds.UNSIGNED_RIGHT_SHIFT);
	setGeneratedBy(higherBits, source);
	BinaryExpression xorParts = new BinaryExpression(ref2, higherBits, OperatorIds.XOR);
	setGeneratedBy(xorParts, source);
	TypeReference intRef = TypeReference.baseTypeReference(TypeIds.T_int, 0);
	intRef.sourceStart = pS; intRef.sourceEnd = pE;
	setGeneratedBy(intRef, source);
	CastExpression expr = makeCastExpression(xorParts, intRef, source);
	expr.sourceStart = pS; expr.sourceEnd = pE;
	return expr;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:17,代码来源:HandleEqualsAndHashCode.java


示例3: generateMethods

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
@Override public void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain) {
	if (useGuavaInstead(builderType)) {
		guavaListSetSingularizer.generateMethods(data, builderType, fluent, chain);
		return;
	}
	
	TypeReference returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	Statement returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generateSingularMethod(returnType, returnStatement, data, builderType, fluent);
	
	returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generatePluralMethod(returnType, returnStatement, data, builderType, fluent);
	
	returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generateClearMethod(returnType, returnStatement, data, builderType);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:19,代码来源:EclipseJavaUtilListSetSingularizer.java


示例4: generateMethods

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
@Override public void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain) {
	if (useGuavaInstead(builderType)) {
		guavaMapSingularizer.generateMethods(data, builderType, fluent, chain);
		return;
	}
	
	TypeReference returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	Statement returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generateSingularMethod(returnType, returnStatement, data, builderType, fluent);
	
	returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generatePluralMethod(returnType, returnStatement, data, builderType, fluent);
	
	returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generateClearMethod(returnType, returnStatement, data, builderType);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:19,代码来源:EclipseJavaUtilMapSingularizer.java


示例5: getNegativeAnnotationMemberValue

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public static Object getNegativeAnnotationMemberValue(
    MemberValuePair memberValuePair, Constant constant) {
  if (constant == null) {
    memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
    return null;
  }
  switch (constant.typeID()) {
    case TypeIds.T_int:
      memberValuePair.valueKind = IMemberValuePair.K_INT;
      return new Integer(constant.intValue() * -1);
    case TypeIds.T_float:
      memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
      return new Float(constant.floatValue() * -1.0f);
    case TypeIds.T_double:
      memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
      return new Double(constant.doubleValue() * -1.0);
    case TypeIds.T_long:
      memberValuePair.valueKind = IMemberValuePair.K_LONG;
      return new Long(constant.longValue() * -1L);
    default:
      memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
      return null;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:Util.java


示例6: getNegativeAnnotationMemberValue

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public static Object getNegativeAnnotationMemberValue(MemberValuePair memberValuePair, Constant constant) {
	if (constant == null) {
		memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
		return null;
	}
	switch (constant.typeID()) {
		case TypeIds.T_int :
			memberValuePair.valueKind = IMemberValuePair.K_INT;
			return new Integer(constant.intValue() * -1);
		case TypeIds.T_float :
			memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
			return new Float(constant.floatValue() * -1.0f);
		case TypeIds.T_double :
			memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
			return new Double(constant.doubleValue() * -1.0);
		case TypeIds.T_long :
			memberValuePair.valueKind = IMemberValuePair.K_LONG;
			return new Long(constant.longValue() * -1L);
		default:
			memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
			return null;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:Util.java


示例7: getConstantValue

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public Object getConstantValue() {
	Constant c = this.binding.constant();
	if (c == null || c == Constant.NotAConstant) return null;
	switch (c.typeID()) {
		case TypeIds.T_boolean:
			return Boolean.valueOf(c.booleanValue());
		case TypeIds.T_byte:
			return new Byte(c.byteValue());
		case TypeIds.T_char:
			return new Character(c.charValue());
		case TypeIds.T_double:
			return new Double(c.doubleValue());
		case TypeIds.T_float:
			return new Float(c.floatValue());
		case TypeIds.T_int:
			return new Integer(c.intValue());
		case TypeIds.T_long:
			return new Long(c.longValue());
		case TypeIds.T_short:
			return new Short(c.shortValue());
		case TypeIds.T_JavaLangString:
			return c.stringValue();
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:VariableBinding.java


示例8: illegalReturnRedefinition

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public void illegalReturnRedefinition(AbstractMethodDeclaration abstractMethodDecl, MethodBinding inheritedMethod, char[][] nonNullAnnotationName) {
	MethodDeclaration methodDecl = (MethodDeclaration) abstractMethodDecl;
	StringBuffer methodSignature = new StringBuffer();
	methodSignature
		.append(inheritedMethod.declaringClass.readableName())
		.append('.')
		.append(inheritedMethod.readableName());

	StringBuffer shortSignature = new StringBuffer();
	shortSignature
		.append(inheritedMethod.declaringClass.shortReadableName())
		.append('.')
		.append(inheritedMethod.shortReadableName());
	int sourceStart = methodDecl.returnType.sourceStart;
	Annotation[] annotations = methodDecl.annotations;
	Annotation annotation = findAnnotation(annotations, TypeIds.T_ConfiguredAnnotationNullable);
	if (annotation != null) {
		sourceStart = annotation.sourceStart;
	}
	this.handle(
		IProblem.IllegalReturnNullityRedefinition, 
		new String[] { methodSignature.toString(), CharOperation.toString(nonNullAnnotationName)},
		new String[] { shortSignature.toString(), new String(nonNullAnnotationName[nonNullAnnotationName.length-1])},
		sourceStart,
		methodDecl.returnType.sourceEnd);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:27,代码来源:ProblemReporter.java


示例9: resolveConstantExpressionValue

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
Object resolveConstantExpressionValue(Expression expression) {
	org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
	if (node instanceof org.eclipse.jdt.internal.compiler.ast.Expression) {
		org.eclipse.jdt.internal.compiler.ast.Expression compilerExpression = (org.eclipse.jdt.internal.compiler.ast.Expression) node;
		Constant constant = compilerExpression.constant;
		if (constant != null && constant != Constant.NotAConstant) {
			switch (constant.typeID()) {
				case TypeIds.T_int : return new Integer(constant.intValue());
				case TypeIds.T_byte : return new Byte(constant.byteValue());
				case TypeIds.T_short : return new Short(constant.shortValue());
				case TypeIds.T_char : return new Character(constant.charValue());
				case TypeIds.T_float : return new Float(constant.floatValue());
				case TypeIds.T_double : return new Double(constant.doubleValue());
				case TypeIds.T_boolean : return constant.booleanValue() ? Boolean.TRUE : Boolean.FALSE;
				case TypeIds.T_long : return new Long(constant.longValue());
				case TypeIds.T_JavaLangString : return constant.stringValue();
			}
			return null;
		}
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:DefaultBindingResolver.java


示例10: nullDefaultAnnotationIsRedundant

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public void nullDefaultAnnotationIsRedundant(ASTNode location, Annotation[] annotations, Binding outer) {
	Annotation annotation = findAnnotation(annotations, TypeIds.T_ConfiguredAnnotationNonNullByDefault);
	int start = annotation != null ? annotation.sourceStart : location.sourceStart;
	int end = annotation != null ? annotation.sourceEnd : location.sourceStart;
	String[] args = NoArgument;
	String[] shortArgs = NoArgument;
	if (outer != null) {
		args = new String[] { new String(outer.readableName()) };
		shortArgs = new String[] { new String(outer.shortReadableName()) };
	}
	int problemId = IProblem.RedundantNullDefaultAnnotation;
	if (outer instanceof PackageBinding) {
		problemId = IProblem.RedundantNullDefaultAnnotationPackage;
	} else if (outer instanceof ReferenceBinding) {
		problemId = IProblem.RedundantNullDefaultAnnotationType;
	} else if (outer instanceof MethodBinding) {
		problemId = IProblem.RedundantNullDefaultAnnotationMethod;
	}
	this.handle(problemId, args, shortArgs, start, end);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:21,代码来源:ProblemReporter.java


示例11: findAnnotation

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
	if (this.annotations != null) {
		Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
		if (innerAnnotations != null) {
			int annId = nullTagBits == TagBits.AnnotationNonNull ? TypeIds.T_ConfiguredAnnotationNonNull : TypeIds.T_ConfiguredAnnotationNullable;
			for (int i = 0; i < innerAnnotations.length; i++) {
				if (innerAnnotations[i] != null 
						&& innerAnnotations[i].resolvedType != null 
						&& innerAnnotations[i].resolvedType.id == annId)
					return innerAnnotations[i];
			}
		}
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:TypeReference.java


示例12: getMarkerInterfaces

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public TypeBinding[] getMarkerInterfaces() {
	if (this.expectedType instanceof IntersectionCastTypeBinding) {
		Set markerBindings = new LinkedHashSet();
		TypeBinding[] intersectionTypes = ((IntersectionCastTypeBinding)this.expectedType).intersectingTypes;
		for (int i = 0,max = intersectionTypes.length; i < max; i++) {
			TypeBinding typeBinding = intersectionTypes[i];
			MethodBinding methodBinding = typeBinding.getSingleAbstractMethod(this.scope, true);
			// Why doesn't getSingleAbstractMethod do as the javadoc says, and return null
			// when it is not a SAM type
			if (!(methodBinding instanceof ProblemMethodBinding && ((ProblemMethodBinding)methodBinding).problemId()==ProblemReasons.NoSuchSingleAbstractMethod)) {
				continue;
			}
			if (typeBinding.id == TypeIds.T_JavaIoSerializable) {
				// Serializable is captured as a bitflag
				continue;
			}
			markerBindings.add(typeBinding);
		}
		if (markerBindings.size() > 0) {
			return (TypeBinding[])markerBindings.toArray(new TypeBinding[markerBindings.size()]);
		}
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:LambdaExpression.java


示例13: reportOnlyUselesslyReadPrivateField

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
void reportOnlyUselesslyReadPrivateField(BlockScope currentScope, FieldBinding fieldBinding, boolean valueRequired) {
	if (valueRequired) {
		// access is relevant, turn compound use into real use:
		fieldBinding.compoundUseFlag = 0;
		fieldBinding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
	} else {
		if (fieldBinding.isUsedOnlyInCompound()) {
			fieldBinding.compoundUseFlag--; // consume one
			if (fieldBinding.compoundUseFlag == 0					// report only the last usage
					&& fieldBinding.isOrEnclosedByPrivateType() 
					&& (this.implicitConversion & TypeIds.UNBOXING) == 0) // don't report if unboxing is involved (might cause NPE)
			{
				// compoundAssignment/postIncrement is the only usage of this field
				currentScope.problemReporter().unusedPrivateField(fieldBinding.sourceField());
				fieldBinding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // don't report again
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:Reference.java


示例14: localVariableNullReference

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public void localVariableNullReference(LocalVariableBinding local, ASTNode location) {
	if (location instanceof Expression && (((Expression)location).implicitConversion & TypeIds.UNBOXING) != 0) {
		nullUnboxing(location, local.type);
		return;
	}
	int severity = computeSeverity(IProblem.NullLocalVariableReference);
	if (severity == ProblemSeverities.Ignore) return;
	String[] arguments = new String[] {new String(local.name)  };
	this.handle(
		IProblem.NullLocalVariableReference,
		arguments,
		arguments,
		severity,
		nodeSourceStart(local, location),
		nodeSourceEnd(local, location));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:ProblemReporter.java


示例15: localVariablePotentialNullReference

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public void localVariablePotentialNullReference(LocalVariableBinding local, ASTNode location) {
	if (location instanceof Expression && (((Expression)location).implicitConversion & TypeIds.UNBOXING) != 0) {
		potentialNullUnboxing(location, local.type);
		return;
	}
	if ((local.type.tagBits & TagBits.AnnotationNullable) != 0 && location instanceof Expression) {
		dereferencingNullableExpression((Expression) location);
		return;
	}
	int severity = computeSeverity(IProblem.PotentialNullLocalVariableReference);
	if (severity == ProblemSeverities.Ignore) return;
	String[] arguments = new String[] {new String(local.name)};
	this.handle(
		IProblem.PotentialNullLocalVariableReference,
		arguments,
		arguments,
		severity,
		nodeSourceStart(local, location),
		nodeSourceEnd(local, location));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:ProblemReporter.java


示例16: addExceptionMarker

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public void addExceptionMarker(int pc, TypeBinding typeBinding) {
	if (this.exceptionMarkers == null) {
		this.exceptionMarkers = new HashSet();
	}
	if (typeBinding == null) {
		this.exceptionMarkers.add(new ExceptionMarker(pc, ConstantPool.JavaLangThrowableConstantPoolName));
	} else {
		switch(typeBinding.id) {
			case TypeIds.T_null :
				this.exceptionMarkers.add(new ExceptionMarker(pc, ConstantPool.JavaLangClassNotFoundExceptionConstantPoolName));
				break;
			case TypeIds.T_long :
				this.exceptionMarkers.add(new ExceptionMarker(pc, ConstantPool.JavaLangNoSuchFieldErrorConstantPoolName));
				break;
			default:
				this.exceptionMarkers.add(new ExceptionMarker(pc, typeBinding.constantPoolName()));
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:StackMapFrameCodeStream.java


示例17: getNumberOfLocals

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
public int getNumberOfLocals() {
	if (this.numberOfLocals != -1) {
		return this.numberOfLocals;
	}
	int result = 0;
	final int length = this.locals == null ? 0 : this.locals.length;
	for(int i = 0; i < length; i++) {
		if (this.locals[i] != null) {
			switch(this.locals[i].id()) {
				case TypeIds.T_double :
				case TypeIds.T_long :
					i++;
			}
			result++;
		}
	}
	this.numberOfLocals = result;
	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:20,代码来源:StackMapFrame.java


示例18: calculateValue

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
/**
 * Returns the actual value of the given Literal or Literal-like node.
 */
public static Object calculateValue(Expression e) {
	if (e instanceof Literal) {
		((Literal)e).computeConstant();
		switch (e.constant.typeID()) {
		case TypeIds.T_int: return e.constant.intValue();
		case TypeIds.T_byte: return e.constant.byteValue();
		case TypeIds.T_short: return e.constant.shortValue();
		case TypeIds.T_char: return e.constant.charValue();
		case TypeIds.T_float: return e.constant.floatValue();
		case TypeIds.T_double: return e.constant.doubleValue();
		case TypeIds.T_boolean: return e.constant.booleanValue();
		case TypeIds.T_long: return e.constant.longValue();
		case TypeIds.T_JavaLangString: return e.constant.stringValue();
		default: return null;
		}
	} else if (e instanceof ClassLiteralAccess) {
		return Eclipse.toQualifiedName(((ClassLiteralAccess)e).type.getTypeName());
	} else if (e instanceof SingleNameReference) {
		return new String(((SingleNameReference)e).token);
	} else if (e instanceof QualifiedNameReference) {
		String qName = Eclipse.toQualifiedName(((QualifiedNameReference)e).tokens);
		int idx = qName.lastIndexOf('.');
		return idx == -1 ? qName : qName.substring(idx+1);
	}
	
	return null;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:31,代码来源:Eclipse.java


示例19: getForEachComponentType

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
private static TypeBinding getForEachComponentType(Expression collection, BlockScope scope) {
	if (collection != null) {
		TypeBinding resolved = collection.resolvedType;
		if (resolved == null) resolved = resolveForExpression(collection, scope);
		if (resolved == null) return null;
		if (resolved.isArrayType()) {
			resolved = ((ArrayBinding) resolved).elementsType();
			return resolved;
		} else if (resolved instanceof ReferenceBinding) {
			ReferenceBinding iterableType = ((ReferenceBinding)resolved).findSuperTypeOriginatingFrom(TypeIds.T_JavaLangIterable, false);
			
			TypeBinding[] arguments = null;
			if (iterableType != null) switch (iterableType.kind()) {
				case Binding.GENERIC_TYPE : // for (T t : Iterable<T>) - in case used inside Iterable itself
					arguments = iterableType.typeVariables();
					break;
				case Binding.PARAMETERIZED_TYPE : // for(E e : Iterable<E>)
					arguments = ((ParameterizedTypeBinding)iterableType).arguments;
					break;
				case Binding.RAW_TYPE : // for(Object e : Iterable)
					return null;
			}
			
			if (arguments != null && arguments.length == 1) {
				return arguments[0];
			}
		}
	}
	
	return null;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:32,代码来源:PatchVal.java


示例20: generateMethods

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入依赖的package包/类
@Override public void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain) {
	TypeReference returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	Statement returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generateSingularMethod(returnType, returnStatement, data, builderType, fluent);
	
	returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generatePluralMethod(returnType, returnStatement, data, builderType, fluent);
	
	returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0);
	returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null;
	generateClearMethod(returnType, returnStatement, data,  builderType);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:14,代码来源:EclipseGuavaSingularizer.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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