public Class<?> findType(String type) throws EvaluationException { return this.relatedContext.getTypeLocator().findType(type); }
public Class<?> findType(String type) throws EvaluationException { return this.relatedContext.getTypeLocator().findType(type); }
Class<?> type = context.getTypeLocator().findType(typeName); Constructor<?>[] ctors = type.getConstructors();
Class<?> type = context.getTypeLocator().findType(typeName); Constructor<?>[] ctors = type.getConstructors();
@Test public void testTypeLocator() throws EvaluationException { ExpressionState state = getState(); assertNotNull(state.getEvaluationContext().getTypeLocator()); assertEquals(Integer.class, state.findType("java.lang.Integer")); try { state.findType("someMadeUpName"); fail("Should have failed to find it"); } catch (EvaluationException ee) { SpelEvaluationException sEx = (SpelEvaluationException)ee; assertEquals(SpelMessage.TYPE_NOT_FOUND, sEx.getMessageCode()); } }
@Override protected void doInit() { Assert.state(this.queryExpression != null || this.collectionCallback != null, "no query or collectionCallback is specified"); Assert.state(this.collectionNameExpression != null, "no collection name specified"); if (this.queryExpression != null && this.collectionCallback != null) { throw new IllegalStateException("query and collectionCallback are mutually exclusive"); } if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { ((StandardTypeLocator) typeLocator).registerImport(Query.class.getPackage().getName()); } } if (this.mongoTemplate == null) { this.mongoTemplate = new MongoTemplate(this.mongoDbFactory, this.mongoConverter); } }
public TypeLocator getTypeLocator() { return this.delegate.getTypeLocator(); }
public TypeLocator getTypeLocator() { return this.delegate.getTypeLocator(); }
public TypeLocator getTypeLocator() { return this.delegate.getTypeLocator(); }
@Override public TypeLocator getTypeLocator() { return this.delegate.getTypeLocator(); }
public TypeLocator getTypeLocator() { return this.delegate.getTypeLocator(); }
public TypeLocator getTypeLocator() { return delegate.getTypeLocator(); }
public TypeLocator getTypeLocator() { return this.delegate.getTypeLocator(); }
@Override protected void onInit() throws Exception { super.onInit(); TypeLocator typeLocator = getEvaluationContext().getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the 'org.springframework.integration.aws.support' package * you don't need a FQCN for the 'SnsMessageBuilder'. */ ((StandardTypeLocator) typeLocator).registerImport("org.springframework.integration.aws.support"); } }
@Override protected void onInit() throws Exception { super.onInit(); TypeLocator typeLocator = getEvaluationContext().getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the 'org.springframework.integration.aws.support' package * you don't need a FQCN for the 'SnsMessageBuilder'. */ ((StandardTypeLocator) typeLocator).registerImport("org.springframework.integration.aws.support"); } }
@Override protected void doInit() { super.doInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the Cassandra Query DSL package so they don't need a FQCN for QueryBuilder, for example. */ ((StandardTypeLocator) typeLocator).registerImport("com.datastax.driver.core.querybuilder"); } }
@Override protected void doInit() { super.doInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the Cassandra Query DSL package so they don't need a FQCN for QueryBuilder, for example. */ ((StandardTypeLocator) typeLocator).registerImport("com.datastax.driver.core.querybuilder"); } }
@Override protected void onInit() throws Exception { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the twitter api package so they don't need a FQCN for TweetData. */ ((StandardTypeLocator) typeLocator).registerImport("org.springframework.social.twitter.api"); } } }
@Override protected void doInit() { super.doInit(); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the twitter api package so they don't need a FQCN for SearchParameters. */ ((StandardTypeLocator) typeLocator).registerImport("org.springframework.social.twitter.api"); } } }
@Override protected void onInit() throws Exception { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { /* * Register the twitter api package so they don't need a FQCN for TweetData. */ ((StandardTypeLocator) typeLocator).registerImport("org.springframework.social.twitter.api"); } } }