org.springframework.expression.spel.CompilablePropertyAccessor Java Examples

The following examples show how to use org.springframework.expression.spel.CompilablePropertyAccessor. 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: PropertyOrFieldReference.java    From spring-analysis-note with 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 File: PropertyOrFieldReference.java    From spring-analysis-note with 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 File: PropertyOrFieldReference.java    From java-technology-stack with 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 File: PropertyOrFieldReference.java    From java-technology-stack with 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
Source File: PropertyOrFieldReference.java    From lams with GNU General Public License v2.0 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;
		this.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
	}
	return tv;
}
 
Example #6
Source File: PropertyOrFieldReference.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: PropertyOrFieldReference.java    From lams with GNU General Public License v2.0 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.exitTypeDescriptor =
				CodeFlow.toDescriptor(((CompilablePropertyAccessor) accessorToUse).getPropertyType());
	}
	return value;
}
 
Example #8
Source File: PropertyOrFieldReference.java    From spring4-understanding with Apache License 2.0 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;
		this.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
	}
	return tv;
}
 
Example #9
Source File: PropertyOrFieldReference.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@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
Source File: PropertyOrFieldReference.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@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 File: PropertyOrFieldReference.java    From spring-analysis-note with 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 File: PropertyOrFieldReference.java    From java-technology-stack with 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
Source File: PropertyOrFieldReference.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean isCompilable() {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	return (accessorToUse instanceof CompilablePropertyAccessor &&
			((CompilablePropertyAccessor) accessorToUse).isCompilable());
}
 
Example #14
Source File: PropertyOrFieldReference.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isCompilable() {
	PropertyAccessor accessorToUse = this.cachedReadAccessor;
	return (accessorToUse instanceof CompilablePropertyAccessor &&
			((CompilablePropertyAccessor) accessorToUse).isCompilable());
}