Class FeatureType<F extends Feature<F>>


  • public abstract class FeatureType<F extends Feature<F>>
    extends java.lang.Object
    Algorithm to select the correct instance of a given feature type for a processing environment, and the default to use in tests when an explicit value has not been registered for that feature.

    Each feature class should expose a single FeatureType constant for the user to pass to SourceBuilder.feature(FeatureType), e.g. SourceLevel.SOURCE_LEVEL.

    • Constructor Summary

      Constructors 
      Constructor Description
      FeatureType()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract F forEnvironment​(javax.annotation.processing.ProcessingEnvironment env, FeatureSet features)
      Returns the instance of F to use in env.
      protected abstract F testDefault​(FeatureSet features)
      Returns the instance of F to use by default in tests.
      protected java.lang.Class<F> type()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FeatureType

        public FeatureType()
    • Method Detail

      • testDefault

        protected abstract F testDefault​(FeatureSet features)
        Returns the instance of F to use by default in tests.
      • forEnvironment

        protected abstract F forEnvironment​(javax.annotation.processing.ProcessingEnvironment env,
                                            FeatureSet features)
        Returns the instance of F to use in env.
      • type

        protected java.lang.Class<F> type()