Class IncludeTraits

  • All Implemented Interfaces:
    ProjectionTransformer

    public final class IncludeTraits
    extends java.lang.Object
    Removes trait definitions when a trait name does not match one of the arguments (a list of trait names). Any instance of the trait is also removed from the model.

    End an arguments with "#" to include the traits from an entire namespace.

    • Constructor Summary

      Constructors 
      Constructor Description
      IncludeTraits()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.function.BiFunction<software.amazon.smithy.model.transform.ModelTransformer,​software.amazon.smithy.model.Model,​software.amazon.smithy.model.Model> createTransformer​(java.util.List<java.lang.String> arguments)
      Creates a function that transforms a model using the provided ModelTransformer.
      java.lang.String getName()
      Gets the name of the transformer.
      • Methods inherited from class java.lang.Object

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

      • IncludeTraits

        public IncludeTraits()
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: ProjectionTransformer
        Gets the name of the transformer.
        Returns:
        Returns the name (e.g., "traits").
      • createTransformer

        public java.util.function.BiFunction<software.amazon.smithy.model.transform.ModelTransformer,​software.amazon.smithy.model.Model,​software.amazon.smithy.model.Model> createTransformer​(java.util.List<java.lang.String> arguments)
        Description copied from interface: ProjectionTransformer
        Creates a function that transforms a model using the provided ModelTransformer.
        Parameters:
        arguments - Arguments used to create the ModelTransformer.
        Returns:
        Returns the created transformer.