Transforms a word symbol-by-symbol, using the specified transformation function.

@param transformer
the transformation function

@return the transformed word
438846
@Nonnull
    public <T> Word<T> transform(Function<? super I, ? extends T> transformer) {
        int len = length();
        Object[] array = new Object[len];
        int i = 0;
        for (I symbol : this) {
            array[i++] = transformer.apply(symbol);
        }
        return new SharedWord<>(array);
    }
623976
function getTransformer(name) {
    if (name in transformers) {
      return transformers[name]
    }
    const transformer = toTransformer(name)
    transformers[name] = transformer ? jstransformer(transformer) : false
    return transformers[name]
  }
362030
@Override
    public byte[] transform(ClassLoader loader,
                            String className,
                            Class<?> classBeingRedefined,
                            ProtectionDomain protectionDomain,
                            byte[] classfileBuffer) throws IllegalClassFormatException {
     	if (detailedTransformTrace && tc.isEntryEnabled())
            Tr.entry(this, tc, "transform", loader, className, classBeingRedefined, protectionDomain);

		    	
		if (!isJava8TraceEnabled)
			return null; //Look for special trace instrumentation force until JDK bug fully fixed.
		
		if (classBeingRedefined != null)
        	return null;

        byte[] newClassBytes = null;
        if (isTransformPossible(classfileBuffer)) {
            try {
                newClassBytes = transform(classfileBuffer);
            } catch (Throwable t) {
                Tr.error(tc, "INSTRUMENTATION_TRANSFORM_FAILED_FOR_CLASS_2", className, t);
            }
        }

        if (detailedTransformTrace && tc.isEntryEnabled())
            Tr.exit(this, tc, "transform", newClassBytes);
        return newClassBytes;
    }
28930
function getTransformer(name, clientPlugin, pluginOptions) {

    // if in cache, just return it
    if (cache[name]) { return cache[name]; }

    var transformers = clientPlugin.transformers;
    var templateDir = clientPlugin.templateDir;

    // if no transformer, throw error
    if (!transformers[name]) { throw new Error('No transformer called ' + name); }

    // generate all the transformers
    _.each(transformers, function (transformer, transformerName) {
        cache[transformerName] = generateTransformer(transformerName, transformer, templateDir, pluginOptions);
    });

    // return the specific one that was requested
    return cache[name];
}
1342908
protected Transformer findTransformer(Class<?> clazz) {
        Transformer answer = transformers.get(clazz);
        if(answer == null)
            throw new IllegalArgumentException("Can not transform value of " + clazz);
        return answer;
    }
200533
public static String transform(Source xml, Source xslt)
    {
        if (xml != null && xslt != null) {
            try {
                StringWriter output = new StringWriter();
                Result result = new StreamResult(output);
                javax.xml.transform.TransformerFactory.newInstance().newTransformer(xslt).transform(xml, result);
                return output.toString();
            } catch (Exception ex) {
                LOGGER.warn("Failed to apply XSLT transformation: [{}]", ex.getMessage());
            }
        }
        return null;
    }
691445
@Override
    public final Transformer getTransformer(
            HttpServletRequest request, HttpServletResponse response) {
        final Resource stylesheetResource = this.getStylesheetResource(request);
        try {
            return this.xmlUtilities.getTransformer(stylesheetResource);
        } catch (TransformerConfigurationException e) {
            throw new RuntimeException(
                    "Failed to get Transformer for stylesheet: " + stylesheetResource, e);
        } catch (IOException e) {
            throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
        }
    }
875619
public static <I> JMSubscriber<I> getJsonStringSOPLSubscriber(
            Function<I, ?> transformFunction) {
        return getSOPLSubscriber(
                o -> JMJson.toJsonString(transformFunction.apply(o)));
    }
882023
public static <T extends Transformer<?>> TransformerBeanDescriptor<T> ofTransformer(Class<T> transformerClass) {
        return new AnnotationBasedTransformerBeanDescriptor<T>(transformerClass);
    }
114605
public Response transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] origBytes) throws IllegalClassFormatException {

    byte[] transformed = first.transform(loader, className, classBeingRedefined, protectionDomain, origBytes);

    boolean firstEnhanced = (transformed != null);
    byte[] nextBytes = (transformed != null) ? transformed : origBytes;
    byte[] finalTransformed = second.transform(loader, className, classBeingRedefined, protectionDomain, nextBytes);

    if (finalTransformed != null) {
      return new Response(finalTransformed, firstEnhanced, true);

    } else if (transformed != null) {
      return new Response(transformed, firstEnhanced, false);
    }
    return Response.NOT_TRANSFORMED;
  }
1059216
function mutator (Glide, Components, Events) {
  /**
   * Merge instance transformers with collection of default transformers.
   * It's important that the Rtl component be last on the list,
   * so it reflects all previous transformations.
   *
   * @type {Array}
   */
  var TRANSFORMERS = [Gap, Grow, Peeking, Focusing].concat(Glide._t, [Rtl]);

  return {
    /**
     * Piplines translate value with registered transformers.
     *
     * @param  {Number} translate
     * @return {Number}
     */
    mutate: function mutate(translate) {
      for (var i = 0; i < TRANSFORMERS.length; i++) {
        var transformer = TRANSFORMERS[i];

        if (isFunction(transformer) && isFunction(transformer().modify)) {
          translate = transformer(Glide, Components, Events).modify(translate);
        } else {
          warn('Transformer should be a function that returns an object with `modify()` method');
        }
      }

      return translate;
    }
  };
}
339991
public static Iterable<Function<Object[], Object[]>> getTransformers(Constructor<?> constructor) {
        Iterable<ArgumentTransformer> transformers = Lists.newArrayList(
                new PrimitiveAwareVarArgsTransformer(constructor),
                new PrimitiveTransformer(constructor),
                new VarArgsTransformer(constructor));

        return ImmutableList
                .<Function<Object[], Object[]>>copyOf(filter(transformers, applicableFilter));
    }
241474
private static void instrumentTransformer(Transformer transformer) throws Exception {
        transformer.setErrorListener(new TransformerErrorListener());

        if (transformer instanceof TransformerHandler) {
            transformer = ((TransformerHandler) transformer).getTransformer();
        }
        if (transformer instanceof TransformerImpl) {
            final TraceManager tm = ((TransformerImpl) transformer).getTraceManager();
            final PrintTraceListener ptl = new PrintTraceListener(new PrintWriter(System.out));
            // Print information as each node is 'executed' in the stylesheet.
            ptl.m_traceElements = true;
            // Print information after each result-tree generation event.
            ptl.m_traceGeneration = true;
            // Print information after each selection event.
            ptl.m_traceSelection = true;
            // Print information whenever a template is invoked.
            ptl.m_traceTemplates = true;
            // Print information whenever an extension call is made.
            ptl.m_traceExtension = true;
            tm.addTraceListener(ptl);
        }
    }
931367
public final String transform(Reader reader, File inputFile) {
		return transform(reader, inputFile, true);
	}
1228969
public void setNumericTransformer(NumericTransformer transformer) {
        mNumericTransformer = transformer != null ? transformer : new DefaultNumericTransformer();
        //We need to refresh the PopupIndicator view
        if (!isInEditMode() && mIndicator != null) {
            if (mNumericTransformer.useStringTransform()) {
                mIndicator.setIndicatorSizes(mNumericTransformer.transformToString(mMax));
            } else {
                mIndicator.setIndicatorSizes(convertValueToMessage(mNumericTransformer.transform(mMax)));
            }
        }
        updateProgressMessage(mValue);
    }
102991
public static void transform(Source source, Result result, String charset, int indent) {
		final TransformerFactory factory = TransformerFactory.newInstance();
		try {
			final Transformer xformer = factory.newTransformer();
			if (indent > 0) {
				xformer.setOutputProperty(OutputKeys.INDENT, "yes");
				xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent));
			}
			if (StrUtil.isNotBlank(charset)) {
				xformer.setOutputProperty(OutputKeys.ENCODING, charset);
			}
			xformer.transform(source, result);
		} catch (Exception e) {
			throw new UtilException(e, "Trans xml document to string error!");
		}
	}
144273
public function setTransformer($transformer)
    {
        if ($transformer !== null) {
            if (!$this->isValidTransformer($transformer)) {
                throw new InvalidTransformerException('Transformer must be a callable or implement TransformerInterface');
            }
        }

        $this->transformer = $transformer;

        return $this;
    }