Class StructAccessExpression

All Implemented Interfaces:
TypedExpression, org.geotools.api.filter.expression.Expression, org.geotools.api.filter.expression.PropertyName

public class StructAccessExpression extends Object implements org.geotools.api.filter.expression.PropertyName, TypedExpression

Access properties by path inside riskscape Tuples

# Thread Safety

This class is not thread-safe, but is probably safe to use in some specific circumstances. It is known not to work and generally perform poorly when a) the same expression is used to access tuples of different types b) that is done across different threads (which can cause IllegalArgumentExceptions to be thrown). In these cases, it's best to use the ExpressionRealizer to rebuild and expression or a filter against a specific struct and use this. It will perform quicker and fail fast in cases of type mismatch.

  • Field Details

  • Constructor Details

    • StructAccessExpression

      public StructAccessExpression(String propertyName)
    • StructAccessExpression

      public StructAccessExpression(String... segmentsParam)
    • StructAccessExpression

      public StructAccessExpression(List<String> segments)
  • Method Details

    • and

      public StructAccessExpression and(String additionalPath)

      Creates a new struct access expression by adding additionalPath to this one.

      additionalPath - additional path element
      new struct access expression
    • evaluateType

      public<> evaluateType( sourceType)
      Description copied from interface: TypedExpression

      The riskscape type this expression will return as a Value

      Specified by:
      evaluateType in interface TypedExpression
    • evaluate

      public Object evaluate(Object object)
      Specified by:
      evaluate in interface org.geotools.api.filter.expression.Expression
    • evaluate

      public <T> T evaluate(Object object, Class<T> context)
      Specified by:
      evaluate in interface org.geotools.api.filter.expression.Expression
    • toString

      public String toString()
      toString in class Object
    • accept

      public Object accept(org.geotools.api.filter.expression.ExpressionVisitor visitor, Object extraData)
      Specified by:
      accept in interface org.geotools.api.filter.expression.Expression
    • getPropertyName

      public String getPropertyName()
      Specified by:
      getPropertyName in interface org.geotools.api.filter.expression.PropertyName
    • getSegments

      public List<String> getSegments()
    • getExpressionFor

      public<StructMemberAccessExpression> getExpressionFor( sourceType)
    • getCachedExpression

      public StructMemberAccessExpression getCachedExpression()
      a possibly null StructMemberAccessExpression that has been built to make subsequent lookups faster
    • getNamespaceContext

      public NamespaceSupport getNamespaceContext()
      Specified by:
      getNamespaceContext in interface org.geotools.api.filter.expression.PropertyName
    • equals

      public boolean equals(Object o)
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      hashCode in class Object