Class ProtobufAccessorNamingStrategy

java.lang.Object
org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
de.firehead.mapstruct.spi.protobuf.accessors.ProtobufAccessorNamingStrategy
All Implemented Interfaces:
org.mapstruct.ap.spi.AccessorNamingStrategy

public class ProtobufAccessorNamingStrategy extends org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
Accessor naming strategy that is aware of the special naming conventions used in protobuf-generated classes.

Optionally supports Immutables as counterpart, much like ImmutablesAccessorNamingStrategy, but doesn't require them.

  • Field Details

    • protobufMarkerInterface

      protected TypeMirror protobufMarkerInterface
      An expected interface used to find out if a type is a protobuf message type (or a builder of one).
    • isImmutables

      protected boolean isImmutables
      Whether Immutables is found on the classpath. If true, we assume that the counterpart for protobuf mapping are Immutables-based data structures.
  • Constructor Details

    • ProtobufAccessorNamingStrategy

      public ProtobufAccessorNamingStrategy()
  • Method Details

    • init

      public void init(org.mapstruct.ap.spi.MapStructProcessingEnvironment aProcessingEnvironment)
      Specified by:
      init in interface org.mapstruct.ap.spi.AccessorNamingStrategy
      Overrides:
      init in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • isGetterMethod

      public boolean isGetterMethod(ExecutableElement aMethod)
      Overrides:
      isGetterMethod in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • isSetterMethod

      public boolean isSetterMethod(ExecutableElement aMethod)
      Overrides:
      isSetterMethod in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • isFluentSetter

      protected boolean isFluentSetter(ExecutableElement aMethod)
      Overrides:
      isFluentSetter in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • isAdderMethod

      public boolean isAdderMethod(ExecutableElement aMethod)
      Overrides:
      isAdderMethod in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • isPresenceCheckMethod

      public boolean isPresenceCheckMethod(ExecutableElement aMethod)
      Overrides:
      isPresenceCheckMethod in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • getElementName

      public String getElementName(ExecutableElement aMethod)
      Specified by:
      getElementName in interface org.mapstruct.ap.spi.AccessorNamingStrategy
      Overrides:
      getElementName in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy
    • getPropertyName

      public String getPropertyName(ExecutableElement aMethod)
      Specified by:
      getPropertyName in interface org.mapstruct.ap.spi.AccessorNamingStrategy
      Overrides:
      getPropertyName in class org.mapstruct.ap.spi.DefaultAccessorNamingStrategy