Class StaticFieldAdapter<T,E extends ExpressionType<T>>

java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<String,E>
org.opentrafficsim.xml.bindings.ExpressionAdapter<T,E>
org.opentrafficsim.xml.bindings.StaticFieldAdapter<T,E>
Type Parameters:
T - value type wrapped in ExpressionType
E - ExpressionType
Direct Known Subclasses:
AnticipationAdapter, CooperationAdapter, EncodingAdapter, EstimationAdapter, GapAcceptanceAdapter, GraphicsTypeAdapter, GtuPositionAdapter, HeadwayDistributionAdapter, InterpolationAdapter, LaneKeepingPolicyAdapter, SynchronizationAdapter, TailgatingAdapter

public abstract class StaticFieldAdapter<T,E extends ExpressionType<T>> extends ExpressionAdapter<T,E>
Superclass for adapters that parse types using static fields, including enums. This class assumes the following to be true for the static fields:
  • The XML type has values that match the static field names exactly.
  • The static field names are present under the type class itself, e.g. Synchronization.PASSIVE is a Synchronization.
  • The type class is either an enum, or its toString() method returns the field name, e.g. Synchronization.PASSIVE.toString() gives "PASSIVE".

Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Wouter Schakel