Java Code Examples for org.springframework.expression.spel.CompilablePropertyAccessor

The following examples show how to use org.springframework.expression.spel.CompilablePropertyAccessor. These examples are extracted from open source projects. 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 Project: spring-analysis-note   Source File: PropertyOrFieldReference.java    License: MIT License 5 votes vote down vote up
@Override
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
	TypedValue tv = getValueInternal(state.getActiveContextObject(), state.getEvaluationContext(),
			state.getConfiguration().isAutoGrowNullReferences());
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) accessorToUse;
		setExitTypeDescriptor(CodeFlow.toDescriptor(accessor.getPropertyType()));
	}
	return tv;
}
 
Example 2
Source Project: spring-analysis-note   Source File: PropertyOrFieldReference.java    License: MIT License 5 votes vote down vote up
@Override
public TypedValue getValue() {
	TypedValue value =
			this.ref.getValueInternal(this.contextObject, this.evalContext, this.autoGrowNullReferences);
	PropertyAccessor accessorToUse = this.ref.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		this.ref.setExitTypeDescriptor(CodeFlow.toDescriptor(((CompilablePropertyAccessor) accessorToUse).getPropertyType()));
	}
	return value;
}
 
Example 3
Source Project: java-technology-stack   Source File: PropertyOrFieldReference.java    License: MIT License 5 votes vote down vote up
@Override
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
	TypedValue tv = getValueInternal(state.getActiveContextObject(), state.getEvaluationContext(),
			state.getConfiguration().isAutoGrowNullReferences());
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) accessorToUse;
		setExitTypeDescriptor(CodeFlow.toDescriptor(accessor.getPropertyType()));
	}
	return tv;
}
 
Example 4
Source Project: java-technology-stack   Source File: PropertyOrFieldReference.java    License: MIT License 5 votes vote down vote up
@Override
public TypedValue getValue() {
	TypedValue value =
			this.ref.getValueInternal(this.contextObject, this.evalContext, this.autoGrowNullReferences);
	PropertyAccessor accessorToUse = this.ref.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		this.ref.setExitTypeDescriptor(CodeFlow.toDescriptor(((CompilablePropertyAccessor) accessorToUse).getPropertyType()));
	}
	return value;
}
 
Example 5
@Override
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
	TypedValue tv = getValueInternal(state.getActiveContextObject(), state.getEvaluationContext(),
			state.getConfiguration().isAutoGrowNullReferences());
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) accessorToUse;
		this.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
	}
	return tv;
}
 
Example 6
@Override
public void generateCode(MethodVisitor mv, CodeFlow cf) {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	if (!(accessorToUse instanceof CompilablePropertyAccessor)) {
		throw new IllegalStateException("Property accessor is not compilable: " + accessorToUse);
	}
	((CompilablePropertyAccessor) accessorToUse).generateCode(this.name, mv, cf);
	cf.pushDescriptor(this.exitTypeDescriptor);
}
 
Example 7
@Override
public TypedValue getValue() {
	TypedValue value =
			this.ref.getValueInternal(this.contextObject, this.evalContext, this.autoGrowNullReferences);
	PropertyAccessor accessorToUse = this.ref.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		this.ref.exitTypeDescriptor =
				CodeFlow.toDescriptor(((CompilablePropertyAccessor) accessorToUse).getPropertyType());
	}
	return value;
}
 
Example 8
@Override
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
	TypedValue tv = getValueInternal(state.getActiveContextObject(), state.getEvaluationContext(),
			state.getConfiguration().isAutoGrowNullReferences());
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	if (accessorToUse instanceof CompilablePropertyAccessor) {
		CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) accessorToUse;
		this.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
	}
	return tv;
}
 
Example 9
@Override
public void generateCode(MethodVisitor mv, CodeFlow cf) {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	if (!(accessorToUse instanceof CompilablePropertyAccessor)) {
		throw new IllegalStateException("Property accessor is not compilable: " + accessorToUse);
	}
	((CompilablePropertyAccessor) accessorToUse).generateCode(this.name, mv, cf);
	cf.pushDescriptor(this.exitTypeDescriptor);
}
 
Example 10
@Override
public TypedValue getValue() {
	TypedValue value = this.ref.getValueInternal(this.contextObject, this.evalContext, this.autoGrowNullReferences);
	if (this.ref.cachedReadAccessor instanceof CompilablePropertyAccessor) {
		CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) this.ref.cachedReadAccessor;
		this.ref.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
	}
	return value;
}
 
Example 11
Source Project: spring-analysis-note   Source File: PropertyOrFieldReference.java    License: MIT License 4 votes vote down vote up
@Override
public boolean isCompilable() {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	return (accessorToUse instanceof CompilablePropertyAccessor &&
			((CompilablePropertyAccessor) accessorToUse).isCompilable());
}
 
Example 12
Source Project: java-technology-stack   Source File: PropertyOrFieldReference.java    License: MIT License 4 votes vote down vote up
@Override
public boolean isCompilable() {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	return (accessorToUse instanceof CompilablePropertyAccessor &&
			((CompilablePropertyAccessor) accessorToUse).isCompilable());
}
 
Example 13
@Override
public boolean isCompilable() {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	return (accessorToUse instanceof CompilablePropertyAccessor &&
			((CompilablePropertyAccessor) accessorToUse).isCompilable());
}
 
Example 14
@Override
public boolean isCompilable() {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	return (accessorToUse instanceof CompilablePropertyAccessor &&
			((CompilablePropertyAccessor) accessorToUse).isCompilable());
}