Java Code Examples for org.eclipse.xtext.xbase.XMemberFeatureCall#getMemberCallTarget()

The following examples show how to use org.eclipse.xtext.xbase.XMemberFeatureCall#getMemberCallTarget() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SerializerScopeProvider.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
protected IScope doGetTypeScope(XMemberFeatureCall call, JvmType type) {
	if (call.isPackageFragment()) {
		if (type instanceof JvmDeclaredType) {
			int segmentIndex = countSegments(call);
			String packageName = ((JvmDeclaredType) type).getPackageName();
			List<String> splitted = Strings.split(packageName, '.');
			String segment = splitted.get(segmentIndex);
			return new SingletonScope(EObjectDescription.create(segment, type), IScope.NULLSCOPE);
		}
		return IScope.NULLSCOPE;
	} else {
		if (type instanceof JvmDeclaredType && ((JvmDeclaredType) type).getDeclaringType() == null) {
			return new SingletonScope(EObjectDescription.create(type.getSimpleName(), type), IScope.NULLSCOPE);
		} else {
			XAbstractFeatureCall target = (XAbstractFeatureCall) call.getMemberCallTarget();
			if (target.isPackageFragment()) {
				String qualifiedName = type.getQualifiedName();
				int dot = qualifiedName.lastIndexOf('.');
				String simpleName = qualifiedName.substring(dot + 1);
				return new SingletonScope(EObjectDescription.create(simpleName, type), IScope.NULLSCOPE);
			} else {
				return new SingletonScope(EObjectDescription.create(type.getSimpleName(), type), IScope.NULLSCOPE);	
			}
		}
	}
}
 
Example 2
Source File: FeatureCallAsTypeLiteralHelper.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
protected XAbstractFeatureCall doGetRootTypeLiteral(XMemberFeatureCall featureCall) {
	boolean staticNotation = featureCall.isExplicitStatic();
	XMemberFeatureCall current = featureCall;
	while(current.eContainingFeature() == XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET) {
		XMemberFeatureCall container = (XMemberFeatureCall) current.eContainer();
		if (container.isExplicitStatic()) {
			if (staticNotation == false) {
				return current;
			}
			current = container;
		} else if (staticNotation) {
			return (XAbstractFeatureCall) current.getMemberCallTarget();
		} else {
			current = container;
		}
	}
	if (current != featureCall && staticNotation) {
		return (XAbstractFeatureCall) current.getMemberCallTarget();
	}
	return null;
}
 
Example 3
Source File: ImportsCollector.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
protected void _visit(final XMemberFeatureCall semanticObj, final INode originNode, final ImportsAcceptor acceptor) {
  if (((semanticObj.getFeature() instanceof JvmType) && semanticObj.isTypeLiteral())) {
    JvmIdentifiableElement _feature = semanticObj.getFeature();
    this.visit(((JvmType) _feature), originNode, acceptor);
  }
  boolean _isExplicitStatic = semanticObj.isExplicitStatic();
  boolean _not = (!_isExplicitStatic);
  if (_not) {
    final XExpression target = semanticObj.getMemberCallTarget();
    if ((target instanceof XAbstractFeatureCall)) {
      boolean _isTypeLiteral = ((XAbstractFeatureCall)target).isTypeLiteral();
      if (_isTypeLiteral) {
        return;
      }
    }
    this.collectStaticImportsFrom(semanticObj, acceptor);
  }
}
 
Example 4
Source File: SARLExpressionHelper.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Convert the boolean constant to the object equivalent if possible.
 *
 * @param expression the expression to convert.
 * @return one of the boolean constants {@link Boolean#TRUE} or {@link Boolean#FALSE},
 *     or {@code null} if the expression is not a constant boolean expression.
 */
@SuppressWarnings("static-method")
public Boolean toBooleanPrimitiveWrapperConstant(XExpression expression) {
	if (expression instanceof XBooleanLiteral) {
		return ((XBooleanLiteral) expression).isIsTrue() ? Boolean.TRUE : Boolean.FALSE;
	}
	if (expression instanceof XMemberFeatureCall) {
		final XMemberFeatureCall call = (XMemberFeatureCall) expression;
		final XExpression receiver = call.getMemberCallTarget();
		if (receiver instanceof XFeatureCall) {
			final XFeatureCall call2 = (XFeatureCall) receiver;
			final String call2Identifier = call2.getConcreteSyntaxFeatureName();
			if (Boolean.class.getSimpleName().equals(call2Identifier) || Boolean.class.getName().equals(call2Identifier)) {
				final String callIdentifier = call.getConcreteSyntaxFeatureName();
				if ("TRUE".equals(callIdentifier)) { //$NON-NLS-1$
					return Boolean.TRUE;
				} else if ("FALSE".equals(callIdentifier)) { //$NON-NLS-1$
					return Boolean.FALSE;
				}
			}
		}
	}
	return null;
}
 
Example 5
Source File: LinkingTest.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Test public void testTypeOfSuper() throws Exception {
	String classAsString = 
		"class Foo extends java.util.ArrayList<String> {" +
		"	def m() {\n" + 
		"		super.add(null)\n" + 
		"	}\n" +
		"}";
	XtendClass clazz = clazz(classAsString);
	XtendFunction function = (XtendFunction) clazz.getMembers().get(0);
	XExpression body = function.getExpression();
	XBlockExpression block = (XBlockExpression) body;
	XMemberFeatureCall featureCall = (XMemberFeatureCall) block.getExpressions().get(0);
	XFeatureCall superCall = (XFeatureCall) featureCall.getMemberCallTarget();
	LightweightTypeReference type = getType(superCall);
	assertEquals("java.util.ArrayList<java.lang.String>", type.getIdentifier());
}
 
Example 6
Source File: LinkingTest.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Test public void testExplicitTypeOverSugar_02() throws Exception {
	XtendFile file = file(
			"import static extension org.eclipse.emf.ecore.util.EcoreUtil.*\n" + 
			"import org.eclipse.emf.ecore.EObject\n" + 
			"import org.eclipse.emf.common.util.URI\n" + 
			"\n" + 
			"class C {\n" + 
			"  def m(EObject it) {\n" + 
			"    URI.appendFragment(\"someString\")\n" + 
			"  }\n" + 
			"}"); 
	XtendClass c = (XtendClass) file.getXtendTypes().get(0);
	XtendFunction m = (XtendFunction) c.getMembers().get(0);
	XBlockExpression body = (XBlockExpression) m.getExpression();
	XMemberFeatureCall featureCall = (XMemberFeatureCall) body.getExpressions().get(0);
	JvmIdentifiableElement method = featureCall.getFeature();
	assertEquals("org.eclipse.emf.common.util.URI.appendFragment(java.lang.String)", method.getIdentifier());
	assertFalse(featureCall.isStaticWithDeclaringType());
	XFeatureCall target = (XFeatureCall) featureCall.getMemberCallTarget();
	assertFalse(target.isTypeLiteral());
	assertEquals("org.eclipse.emf.ecore.util.EcoreUtil.getURI(org.eclipse.emf.ecore.EObject)", target.getFeature().getIdentifier());
}
 
Example 7
Source File: LinkingTest.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Test public void testExplicitTypeOverSugar_01() throws Exception {
	XtendFile file = file(
			"import static extension org.eclipse.emf.ecore.util.EcoreUtil.*\n" + 
			"import org.eclipse.emf.ecore.EObject\n" + 
			"import org.eclipse.emf.common.util.URI\n" + 
			"\n" + 
			"class C {\n" + 
			"  def m(EObject it) {\n" + 
			"    URI::createURI(\"someString\")\n" + 
			"  }\n" + 
			"}"); 
	XtendClass c = (XtendClass) file.getXtendTypes().get(0);
	XtendFunction m = (XtendFunction) c.getMembers().get(0);
	XBlockExpression body = (XBlockExpression) m.getExpression();
	XMemberFeatureCall featureCall = (XMemberFeatureCall) body.getExpressions().get(0);
	JvmIdentifiableElement method = featureCall.getFeature();
	assertEquals("org.eclipse.emf.common.util.URI.createURI(java.lang.String)", method.getIdentifier());
	assertTrue(featureCall.isStaticWithDeclaringType());
	XFeatureCall target = (XFeatureCall) featureCall.getMemberCallTarget();
	assertTrue(target.isTypeLiteral());
	assertEquals("org.eclipse.emf.common.util.URI", target.getFeature().getIdentifier());
}
 
Example 8
Source File: TypeProviderTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
protected void doTestBug403357(String expression, String expectation) throws Exception {
	XtendFile file = file(
			"import java.util.List\n" +
			"class C {\n" +
			"	def static m() {\n" + 
			"		printMe(" + expression +")\n" +
			"		" + expression +".printMe\n" +
			"		val list = " + expression + "\n" +
			"		printMe(list)\n" +
			"		list.printMe\n" + 
			"	}\n" +
			"	static def void printMe(List<String> listOfStrings) {}" + 
			"}\n"); 
	XtendClass c = (XtendClass) file.getXtendTypes().get(0);
	XtendFunction function = (XtendFunction) c.getMembers().get(0);
	XBlockExpression body = (XBlockExpression) function.getExpression();
	XFeatureCall featureCall = (XFeatureCall) body.getExpressions().get(0);
	XExpression firstArgument = featureCall.getFeatureCallArguments().get(0);
	assertEquals(expectation, getType(firstArgument).getSimpleName());
	XMemberFeatureCall memberFeatureCall = (XMemberFeatureCall) body.getExpressions().get(1);
	XExpression target = memberFeatureCall.getMemberCallTarget();
	assertEquals(expectation, getType(target).getSimpleName());
	XFeatureCall deferredFeatureCall = (XFeatureCall) body.getExpressions().get(3);
	XExpression deferredFirstArgument = deferredFeatureCall.getFeatureCallArguments().get(0);
	assertEquals(expectation, getType(deferredFirstArgument).getSimpleName());
	XMemberFeatureCall deferredMemberFeatureCall = (XMemberFeatureCall) body.getExpressions().get(4);
	XExpression deferredTarget = deferredMemberFeatureCall.getMemberCallTarget();
	assertEquals(expectation, getType(deferredTarget).getSimpleName());
}
 
Example 9
Source File: AbstractExtraLanguageValidator.java    From sarl with Apache License 2.0 5 votes vote down vote up
private boolean internalCheckMemberFeaturCallMapping(XAbstractFeatureCall featureCall,
		Procedure3<? super EObject, ? super JvmType, ? super String> typeErrorHandler,
		Function2<? super EObject, ? super JvmIdentifiableElement, ? extends Boolean> featureErrorHandler) {
	final ExtraLanguageFeatureNameConverter converter = getFeatureNameConverter();
	if (converter != null) {
		final ConversionType conversionType = converter.getConversionTypeFor(featureCall);
		switch (conversionType) {
		case EXPLICIT:
			return true;
		case IMPLICIT:
			final JvmIdentifiableElement element = featureCall.getFeature();
			if (element instanceof JvmType) {
				return doTypeMappingCheck(featureCall, (JvmType) element, typeErrorHandler);
			}
			if (featureCall instanceof XMemberFeatureCall) {
				final XMemberFeatureCall memberFeatureCall = (XMemberFeatureCall) featureCall;
				final XExpression receiver = memberFeatureCall.getMemberCallTarget();
				if (receiver instanceof XMemberFeatureCall || receiver instanceof XFeatureCall) {
					internalCheckMemberFeaturCallMapping(
							(XAbstractFeatureCall) receiver,
							typeErrorHandler,
							featureErrorHandler);
				}
			}
			break;
		case FORBIDDEN_CONVERSION:
		default:
			if (featureErrorHandler != null) {
				return !featureErrorHandler.apply(featureCall, featureCall.getFeature());
			}
			return false;
		}
	}
	return true;
}
 
Example 10
Source File: ErrorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testErrorModel_020() throws Exception {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package x");
  _builder.newLine();
  _builder.append("class Y {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@com.google.inject.Inject extension test.GenericExtensionMethods<String,Integer> x");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def foo(String arg) {");
  _builder.newLine();
  _builder.append("\t\t");
  _builder.append("arg.method");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final XtendFile file = this.processWithoutException(_builder);
  final XtendTypeDeclaration y = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
  XtendMember _last = IterableExtensions.<XtendMember>last(y.getMembers());
  final XtendFunction function = ((XtendFunction) _last);
  XExpression _expression = function.getExpression();
  final XBlockExpression body = ((XBlockExpression) _expression);
  XExpression _head = IterableExtensions.<XExpression>head(body.getExpressions());
  final XMemberFeatureCall featureCall = ((XMemberFeatureCall) _head);
  XExpression _implicitReceiver = featureCall.getImplicitReceiver();
  final XMemberFeatureCall implicitReceiver = ((XMemberFeatureCall) _implicitReceiver);
  final XExpression this_ = implicitReceiver.getMemberCallTarget();
  final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(this_);
  Assert.assertNotNull(resolvedTypes.getActualType(this_));
}
 
Example 11
Source File: RichStringEvaluationTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void acceptForLoop(/* @NonNull */ JvmFormalParameter parameter, /* @NonNull */ XExpression expression) {
	if (!ignore()) {
		XMemberFeatureCall featureCall = (XMemberFeatureCall) expression;
		XStringLiteral receiver = (XStringLiteral) featureCall.getMemberCallTarget();
		int length = receiver.getValue().length();
		if (length != 0)
			forLoopStack.push(length * -1);
		else
			forLoopStack.push(null);
	}
}
 
Example 12
Source File: TypeLiteralHelper.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
protected void applyPackageFragment(XMemberFeatureCall memberFeatureCall, JvmDeclaredType type) {
	XExpression target = memberFeatureCall.getMemberCallTarget();
	state.getResolvedTypes().acceptType(
			target, 
			new NoExpectation(state, false),
			state.getReferenceOwner().newParameterizedTypeReference(type),
			false,
			ConformanceFlags.CHECKED_SUCCESS);
	if (target instanceof XMemberFeatureCall) {
		applyPackageFragment((XMemberFeatureCall) target, type);
	}
}
 
Example 13
Source File: CreateMemberQuickfixes.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
protected boolean isStaticAccess(XAbstractFeatureCall call) {
	if (call instanceof XMemberFeatureCall) {
		XMemberFeatureCall featureCall = (XMemberFeatureCall) call;
		if (featureCall.isExplicitStatic()) {
			return true;
		}
		if (featureCall.getMemberCallTarget() instanceof XAbstractFeatureCall) {
			XAbstractFeatureCall targetCall = (XAbstractFeatureCall) featureCall.getMemberCallTarget();
			if ( targetCall.isTypeLiteral()) {
				return true;
			}
		}
	}
	return isStatic(logicalContainerProvider.getNearestLogicalContainer(call)); 
}
 
Example 14
Source File: AbstractXbaseLinkingTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testRecursiveClosure_02() throws Exception {
	XBlockExpression block = (XBlockExpression) expression("{ val (int)=>int fun = [ self.apply(it) ] }");
	XVariableDeclaration variable = (XVariableDeclaration) block.getExpressions().get(0);
	XClosure closure = (XClosure) variable.getRight();
	XBlockExpression body = (XBlockExpression) closure.getExpression();
	XMemberFeatureCall member = (XMemberFeatureCall) body.getExpressions().get(0);
	XFeatureCall recursive = (XFeatureCall) member.getMemberCallTarget();
	assertEquals(Functions.Function1.class.getName(), recursive.getFeature().getQualifiedName('$'));
}
 
Example 15
Source File: AbstractXbaseLinkingTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testRecursiveClosure() throws Exception {
	XBlockExpression block = (XBlockExpression) expression("{ val (int)=>int fun = [ fun.apply(it) ] }");
	XVariableDeclaration variable = (XVariableDeclaration) block.getExpressions().get(0);
	XClosure closure = (XClosure) variable.getRight();
	XBlockExpression body = (XBlockExpression) closure.getExpression();
	XMemberFeatureCall member = (XMemberFeatureCall) body.getExpressions().get(0);
	XFeatureCall recursive = (XFeatureCall) member.getMemberCallTarget();
	assertSame(variable, recursive.getFeature());
}
 
Example 16
Source File: FeatureCallCompiler.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
protected boolean appendReceiver(XAbstractFeatureCall call, ITreeAppendable b, @SuppressWarnings("unused") boolean isExpressionContext) {
	if (call.isStatic()) {
		if (expressionHelper.findInlineAnnotation(call) != null) {
			return false;
		}
		if (call instanceof XMemberFeatureCall) {
			XMemberFeatureCall memberFeatureCall = (XMemberFeatureCall) call;
			if (memberFeatureCall.isStaticWithDeclaringType()) {
				XAbstractFeatureCall target = (XAbstractFeatureCall) memberFeatureCall.getMemberCallTarget();
				JvmType declaringType = (JvmType) target.getFeature();
				b.trace(target, false).append(declaringType);
				return true;
			}
		}
		b.append(((JvmFeature) call.getFeature()).getDeclaringType());
		return true;
	}
	XExpression receiver = getActualReceiver(call);
	if (receiver != null) {
		internalToJavaExpression(receiver, b);
		if (receiver instanceof XAbstractFeatureCall) {
			// some local types have a reference name bound to the empty string
			// which is the reason why we have to check for an empty string as a valid
			// reference name here
			// see AnonymousClassCompilerTest.testCapturedLocalVar_04
			// if it turns out that we have to deal with generics there too, we may
			// have to create a field in the synthesized local class with a unique
			// name that points to 'this'
			if (((XAbstractFeatureCall) receiver).getFeature() instanceof JvmType) {
				String referenceName = getReferenceName(receiver, b);
				if (referenceName != null && referenceName.length() == 0) {
					return false;
				}
			}
		}
		return true;
	} else {
		return false;
	}
}
 
Example 17
Source File: XtendHoverSignatureProviderTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Test
public void test381185() {
  try {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("package testPackage");
    _builder.newLine();
    _builder.append("class Foo{");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Bar b");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def bar(){ ");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("b.foo");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("class Bar {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Foo f");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def foo() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("f.bar");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    final XtendFile xtendFile = this.parseHelper.parse(_builder, this.getResourceSet());
    final XtendClass clazz = IterableExtensions.<XtendClass>head(Iterables.<XtendClass>filter(xtendFile.getXtendTypes(), XtendClass.class));
    final XtendClass clazz2 = IterableExtensions.<XtendClass>head(IterableExtensions.<XtendClass>drop(Iterables.<XtendClass>filter(xtendFile.getXtendTypes(), XtendClass.class), 1));
    XtendMember _get = clazz.getMembers().get(1);
    final XtendFunction function1 = ((XtendFunction) _get);
    XtendMember _get_1 = clazz2.getMembers().get(1);
    final XtendFunction function2 = ((XtendFunction) _get_1);
    XExpression _expression = function1.getExpression();
    final XBlockExpression expression1 = ((XBlockExpression) _expression);
    XExpression _expression_1 = function2.getExpression();
    final XBlockExpression expression2 = ((XBlockExpression) _expression_1);
    XExpression _get_2 = expression1.getExpressions().get(0);
    final XMemberFeatureCall call1 = ((XMemberFeatureCall) _get_2);
    XExpression _get_3 = expression2.getExpressions().get(0);
    final XMemberFeatureCall call2 = ((XMemberFeatureCall) _get_3);
    Assert.assertEquals("Object Bar.foo()", this.signatureProvider.getSignature(call1.getFeature()));
    Assert.assertEquals("Object Foo.bar()", this.signatureProvider.getSignature(call2.getFeature()));
    XExpression _memberCallTarget = call1.getMemberCallTarget();
    Assert.assertEquals("Bar Foo.b", this.signatureProvider.getSignature(((XFeatureCall) _memberCallTarget).getFeature()));
    XExpression _memberCallTarget_1 = call2.getMemberCallTarget();
    Assert.assertEquals("Foo Bar.f", this.signatureProvider.getSignature(((XFeatureCall) _memberCallTarget_1).getFeature()));
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
Example 18
Source File: AbstractExpressionGenerator.java    From sarl with Apache License 2.0 4 votes vote down vote up
/** Compute the list of object that serve as the receiver for the given call.
 *
 * @param call the feature call to analyze.
 * @param output the objects that constitute the call's receiver.
 * @param thisKeyword the "this" keyword.
 * @param referenceNameDefinition replies the name of the expression, if defined.
 * @return {@code true} if a receiver was found; otherwise {@code false}.
 */
public static boolean buildCallReceiver(XAbstractFeatureCall call, Function0<? extends String> thisKeyword,
		Function1<? super XExpression, ? extends String> referenceNameDefinition, List<Object> output) {
	if (call.isStatic()) {
		if (call instanceof XMemberFeatureCall) {
			final XMemberFeatureCall memberFeatureCall = (XMemberFeatureCall) call;
			if (memberFeatureCall.isStaticWithDeclaringType()) {
				final XAbstractFeatureCall target = (XAbstractFeatureCall) memberFeatureCall.getMemberCallTarget();
				final JvmType declaringType = (JvmType) target.getFeature();
				output.add(declaringType);
				return true;
			}
		}
		output.add(((JvmFeature) call.getFeature()).getDeclaringType());
		return true;
	}
	final XExpression receiver = call.getActualReceiver();
	if (receiver == null) {
		return false;
	}
	final XExpression implicit = call.getImplicitReceiver();
	if (receiver == implicit) {
		output.add(thisKeyword.apply());
	} else {
		output.add(receiver);
		if (receiver instanceof XAbstractFeatureCall) {
			// some local types have a reference name bound to the empty string
			// which is the reason why we have to check for an empty string as a valid
			// reference name here
			// see AnonymousClassCompilerTest.testCapturedLocalVar_04
			// if it turns out that we have to deal with generics there too, we may
			// have to create a field in the synthesized local class with a unique
			// name that points to 'this'
			if (((XAbstractFeatureCall) receiver).getFeature() instanceof JvmType) {
				final String referenceName = referenceNameDefinition.apply(receiver);
				if (referenceName != null && referenceName.length() == 0) {
					return false;
				}
			}
		}
	}
	return true;
}