Class Transformers.Factory

  • Enclosing interface:
    Transformers

    public static class Transformers.Factory
    extends Object
    Convenience factory for unit tests, and default internal implementations
    • Method Detail

      • create

        public static Transformers create​(TransformationTarget target)
        Returns a transformers object appropriate for the given target process.
        Parameters:
        target - the transformation target
        Returns:
        the transformers instance. Will not be null
      • create

        public static ResourceTransformationContext create​(TransformationTarget target,
                                                           Resource model,
                                                           ImmutableManagementResourceRegistration registration,
                                                           ExpressionResolver resolver,
                                                           RunningMode runningMode,
                                                           ProcessType type,
                                                           TransformerOperationAttachment attachment)
        Creates a ResourceTransformationContext
        Parameters:
        target - the transformation target
        model - the model
        registration - the resource registration
        resolver - the expression resolver
        runningMode - the server running mode
        type - the process type
        attachment - attachments propagated from the operation context to the created transformer context. This may be null. In a non-test scenario, this will be added by operation handlers triggering the transformation, but for tests this needs to be hard-coded. Tests will need to ensure themselves that the relevant attachments get set.
        Returns:
        the created context Will not be null
      • createLocal

        public static Transformers createLocal()
        Create a local transformer, which will use the default transformation rules, however still respect the ignored resource transformation.
        Returns:
        the transformers instance. Will not be null