Generate a transformer object based off the input params
@param name
@param transformerFns
@param templateDir
@param pluginOptions
11380
function generateTransformer(name, transformerFns, templateDir, pluginOptions) {

    var Transformer = function () {};
    var transformer = new Transformer();

    // add function mixins to the transformer
    _.extend(transformer, transformerFns, baseTransformer, annotationHelper, utensils, pluginOptions);

    // add reference to the template function
    transformer.setTemplate(templateDir, name, pluginOptions.clientType);

    // each transformer can reference each other
    transformer.transformers = cache;

    // return the transformer
    return transformer;
}
814996
function(compiler, compilation, params){
    compilation.dependencyFactories.set(AngularModuleDependency,
                                        params.normalModuleFactory);
    compilation.dependencyTemplates.set(AngularModuleDependency,
                                        new AngularModuleDependency.Template());
    compilation.dependencyFactories.set(AngularModuleDefinition,
                                        new NullFactory());
    compilation.dependencyTemplates.set(AngularModuleDefinition,
                                        new AngularModuleDefinition.Template());
  }
367655
public void transform(Source source, boolean shouldRelease) throws TransformerException
  {

    try
    {
        
      // Patch for bugzilla #13863.  If we don't reset the namespaceContext
      // then we will get a NullPointerException if transformer is reused 
      // (for stylesheets that use xsl:key).  Not sure if this should go 
      // here or in reset(). -is  
      if(getXPathContext().getNamespaceContext() == null){
         getXPathContext().setNamespaceContext(getStylesheet());
      }
      String base = source.getSystemId();
      
      // If no systemID of the source, use the base of the stylesheet.
      if(null == base)
      {
        base = m_stylesheetRoot.getBaseIdentifier();
      }

      // As a last resort, use the current user dir.
      if(null == base)
      {
        String currentDir = "";
        try {
          currentDir = System.getProperty("user.dir");
        }
        catch (SecurityException se) {}// user.dir not accessible from applet
              
        if (currentDir.startsWith(java.io.File.separator))
          base = "file://" + currentDir;
        else
          base = "file:///" + currentDir;
        
        base = base + java.io.File.separatorChar
               + source.getClass().getName();
      }
      setBaseURLOfSource(base);
      DTMManager mgr = m_xcontext.getDTMManager();
      /*
       * According to JAXP1.2, new SAXSource()/StreamSource()
       * should create an empty input tree, with a default root node. 
       * new DOMSource()creates an empty document using DocumentBuilder.
       * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations,
       * since there is no clear spec. how to create an empty tree when
       * both SAXSource() and StreamSource() are used.
       */
      if ((source instanceof StreamSource && source.getSystemId()==null &&
         ((StreamSource)source).getInputStream()==null &&
         ((StreamSource)source).getReader()==null)||
         (source instanceof SAXSource &&
         ((SAXSource)source).getInputSource()==null &&
         ((SAXSource)source).getXMLReader()==null )||
         (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){
        try {
          DocumentBuilderFactory builderF = 
                   DocumentBuilderFactory.newInstance();
          DocumentBuilder builder = builderF.newDocumentBuilder();
          String systemID = source.getSystemId();
          source = new DOMSource(builder.newDocument());

          // Copy system ID from original, empty Source to new Source
          if (systemID != null) {
            source.setSystemId(systemID);
          }
        } catch (ParserConfigurationException e) {
          fatalError(e);
        }           
      }
      DTM dtm = mgr.getDTM(source, false, this, true, true);
      dtm.setDocumentBaseURI(base);
      
      boolean hardDelete = true;  // %REVIEW% I have to think about this. -sb

      try
      {
      	// NOTE: This will work because this is _NOT_ a shared DTM, and thus has
      	// only a single Document node. If it could ever be an RTF or other
      	// shared DTM, look at dtm.getDocumentRoot(nodeHandle).
        this.transformNode(dtm.getDocument());
      }
      finally
      {
        if (shouldRelease)
          mgr.release(dtm, hardDelete);
      }

      // Kick off the parse.  When the ContentHandler gets 
      // the startDocument event, it will call transformNode( node ).
      // reader.parse( xmlSource );
      // This has to be done to catch exceptions thrown from 
      // the transform thread spawned by the STree handler.
      Exception e = getExceptionThrown();

      if (null != e)
      {
        if (e instanceof javax.xml.transform.TransformerException)
        {
          throw (javax.xml.transform.TransformerException) e;
        }
        else if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
        {
          fatalError(
              ((org.apache.xml.utils.WrappedRuntimeException) e).getException());
        }
        else
        {
          throw new javax.xml.transform.TransformerException(e);
        }
      }
      else if (null != m_serializationHandler)
      {
        m_serializationHandler.endDocument();
      }
    }
    catch (org.apache.xml.utils.WrappedRuntimeException wre)
    {
      Throwable throwable = wre.getException();

      while (throwable
             instanceof org.apache.xml.utils.WrappedRuntimeException)
      {
        throwable =
          ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException();
      }

      fatalError(throwable);
    }

    // Patch attributed to David Eisenberg <david@catcode.com>
    catch (org.xml.sax.SAXParseException spe)
    {
      fatalError(spe);
    }
    catch (org.xml.sax.SAXException se)
    {
      m_errorHandler.fatalError(new TransformerException(se));
    }
    finally
    {
      m_hasTransformThreadErrorCatcher = false;

      // This looks to be redundent to the one done in TransformNode.
      reset();
    }
  }
335947
private void generateGetStaticRenderFunctions(ComponentExposedTypeGenerator exposedTypeGenerator,
      VueTemplateCompilerResult result) {
    CodeBlock.Builder staticFunctions = CodeBlock.builder();

    boolean isFirst = true;
    for (String staticRenderFunction : result.getStaticRenderFunctions()) {
      if (!isFirst) {
        staticFunctions.add(", ");
      } else {
        isFirst = false;
      }

      staticFunctions.add("new $T($S)", Function.class, staticRenderFunction);
    }

    MethodSpec.Builder getStaticRenderFunctionsBuilder = MethodSpec
        .methodBuilder("getStaticRenderFunctions")
        .addModifiers(Modifier.PRIVATE)
        .returns(Function[].class)
        .addStatement("return new $T[] { $L }", Function.class, staticFunctions.build());

    exposedTypeGenerator.getClassBuilder().addMethod(getStaticRenderFunctionsBuilder.build());
  }
40057
public void templateModem_name_PUT(String name, OvhTemplateModem body) throws IOException {
		String qPath = "/xdsl/templateModem/{name}";
		StringBuilder sb = path(qPath, name);
		exec(qPath, "PUT", sb.toString(), body);
	}
1032653
function(pluginOptions) {
    if (!pluginOptions) {
        pluginOptions = {
            comments: false
        };
    }

    // Default options
    if (typeof pluginOptions.comments !== 'boolean') {
        pluginOptions.comments = false;
    }

    return map(function(file, cb) {
        var result = jsonlint(file.contents.toString('utf8'), pluginOptions);
        file.jsonlint = {
            error: result.error,
            line: result.line,
            character: result.character
        };

        // Pass file
        cb(null, file);
    });
}
1172766
public static void switchSerializerIfHTML(
          TransformerImpl transformer, String ns, String localName)
            throws TransformerException
  {

    if (null == transformer)
      return;

    if (((null == ns) || (ns.length() == 0))
            && localName.equalsIgnoreCase("html"))
    {
      // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+
      //              transformer.getOutputPropertyNoDefault(OutputKeys.METHOD));     
      // Access at level of hashtable to see if the method has been set.
      if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD))
        return;

      // Getting the output properties this way won't cause a clone of 
      // the properties.
      Properties prevProperties = transformer.getOutputFormat().getProperties();
      
      // We have to make sure we get an output properties with the proper 
      // defaults for the HTML method.  The easiest way to do this is to 
      // have the OutputProperties class do it.
      OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML);

      htmlOutputProperties.copyFrom(prevProperties, true);
      Properties htmlProperties = htmlOutputProperties.getProperties();

      try
      {
//        Serializer oldSerializer = transformer.getSerializer();
        Serializer oldSerializer = null;

        if (null != oldSerializer)
        {
          Serializer serializer =
            SerializerFactory.getSerializer(htmlProperties);

          Writer writer = oldSerializer.getWriter();

          if (null != writer)
            serializer.setWriter(writer);
          else
          {
            OutputStream os = oldSerializer.getOutputStream();

            if (null != os)
              serializer.setOutputStream(os);
          }

//          transformer.setSerializer(serializer);

          ContentHandler ch = serializer.asContentHandler();

          transformer.setContentHandler(ch);
        }
      }
      catch (java.io.IOException e)
      {
        throw new TransformerException(e);
      }
    }
  }
712955
protected Transformer _newTransformer()
    {
        Transformer  transformer = null;

        if (_stylesheet == null) {
            try {
                transformer = TransformerFactory.newInstance().newTransformer();
            } catch (Exception ex) {
                throw new XmlException( ex );
            }

            return transformer;
        }

        if (_templates == null) {
            _templates = _getTemplates( _stylesheet );
        }

        try {
            transformer = _templates.newTransformer();
                                     //throws TransformerConfigurationException

            if (_params.size() > 0) {
                for (String  name : _params.keySet()) {
                    Object  value = _params.get( name );
                    transformer.setParameter( name, value );
                }
            }
        } catch (Exception ex) {
            throw new XmlException( ex );
        }

        return transformer;
    }
45311
public void generate(TypeElement component) {
    ClassName vueFactoryClassName = componentFactoryName(component);

    Builder vueFactoryBuilder = createFactoryBuilderClass(component, vueFactoryClassName);

    createGetName(vueFactoryBuilder, component);
    createProperties(vueFactoryClassName, vueFactoryBuilder);
    List<CodeBlock> staticInitParameters = createInitMethod(component, vueFactoryBuilder);
    createStaticGetMethod(component,
        vueFactoryClassName,
        vueFactoryBuilder,
        staticInitParameters);

    vueFactoryBuilder.addMethod(MethodSpec
        .constructorBuilder()
        .addModifiers(Modifier.PROTECTED)
        .addAnnotation(Inject.class)
        .build());

    // Build the ComponentOptions class
    GeneratorsUtil.toJavaFile(filer, vueFactoryBuilder, vueFactoryClassName, component);
  }
384427
function(pluginName, defaultOptions) {
		
		var self = this,
			options = $.extend(true, {}, defaultOptions);
		
		// if the plugin options were isolated in a property named after the
		// plugin, use them (prevents conflicts with other plugins)
		var pluginOptions = self.__options[pluginName];
		
		// if not, try to get them as regular options
		if (!pluginOptions){
			
			pluginOptions = {};
			
			$.each(defaultOptions, function(optionName, value) {
				
				var o = self.__options[optionName];
				
				if (o !== undefined) {
					pluginOptions[optionName] = o;
				}
			});
		}
		
		// let's merge the default options and the ones that were provided. We'd want
		// to do a deep copy but not let jQuery merge arrays, so we'll do a shallow
		// extend on two levels, that will be enough if options are not more than 1
		// level deep
		$.each(options, function(optionName, value) {
			
			if (pluginOptions[optionName] !== undefined) {
				
				if ((		typeof value == 'object'
						&&	!(value instanceof Array)
						&&	value != null
					)
					&&
					(		typeof pluginOptions[optionName] == 'object'
						&&	!(pluginOptions[optionName] instanceof Array)
						&&	pluginOptions[optionName] != null
					)
				) {
					$.extend(options[optionName], pluginOptions[optionName]);
				}
				else {
					options[optionName] = pluginOptions[optionName];
				}
			}
		});
		
		return options;
	}
86276
function (pluginOptions) {
    // If user options are undefined, set an empty options object
    if (!pluginOptions) {
        pluginOptions = {};
    }
    // Save off pluginOptions so we can get it in `report()`
    tslintPlugin.pluginOptions = pluginOptions;
    // TSLint default options
    var options = {
        fix: pluginOptions.fix || false,
        formatter: pluginOptions.formatter || "prose",
        formattersDirectory: pluginOptions.formattersDirectory || null,
        rulesDirectory: pluginOptions.rulesDirectory || null
    };
    var linter = getTslint(pluginOptions);
    var tslint = new linter.Linter(options, pluginOptions.program);
    return map(function (file, cb) {
        // Skip
        if (file.isNull()) {
            return cb(null, file);
        }
        // Stream is not supported
        if (file.isStream()) {
            return cb(new PluginError("gulp-tslint", "Streaming not supported"));
        }
        var configuration = (pluginOptions.configuration === null ||
            pluginOptions.configuration === undefined ||
            isString(pluginOptions.configuration))
            // Configuration can be a file path or null, if it's unknown
            ? linter.Configuration.findConfiguration(pluginOptions.configuration || null, file.path).results
            : pluginOptions.configuration;
        tslint.lint(file.path, file.contents.toString("utf8"), configuration);
        file.tslint = tslint.getResult();
        // Clear all results for current file from tslint
        tslint.failures = [];
        tslint.fixes = [];
        // Pass file
        cb(null, file);
    });
}
158557
private SoySauce doCompileSoySauce(
      ServerCompilationPrimitives primitives, Map<String, Supplier<Object>> pluginInstances) {
    Optional<CompiledTemplates> templates =
        BytecodeCompiler.compile(
            primitives.registry,
            primitives.soyTree,
            // if there is an AST cache, assume we are in 'dev mode' and trigger lazy compilation.
            cache != null,
            errorReporter,
            soyFileSuppliers,
            typeRegistry);

    throwIfErrorsPresent();

    return new SoySauceImpl(
        templates.get(),
        scopedData.enterable(),
        soyFunctionMap,
        printDirectives,
        ImmutableMap.copyOf(pluginInstances));
  }
746364
public function buildTypoScriptRenderingConfiguration($extensionName, $pluginName, $contextRecord)
    {
        $configurationBuilder = new RecordRenderingConfigurationBuilder(new RenderingContext($GLOBALS['TSFE']));
        return $configurationBuilder->configurationFor($extensionName, $pluginName, $contextRecord);
    }
633208
protected void parseNodeTypeDefinition( TokenStream tokens ) {
        // Parse the name, and create the path and a property for the name ...
        Name name = parseNodeTypeName(tokens);
        JcrNodeTypeTemplate nodeType = new JcrNodeTypeTemplate(context);
        try {
            nodeType.setName(string(name));
        } catch (ConstraintViolationException e) {
            assert false : "Names should always be syntactically valid";
        }

        // Read the (optional) supertypes ...
        List<Name> supertypes = parseSupertypes(tokens);
        try {
            nodeType.setDeclaredSuperTypeNames(names(supertypes));

            // Read the node type options (and vendor extensions) ...
            parseNodeTypeOptions(tokens, nodeType);

            // Parse property and child node definitions ...
            parsePropertyOrChildNodeDefinitions(tokens, nodeType);
        } catch (ConstraintViolationException e) {
            assert false : "Names should always be syntactically valid";
        }

        this.nodeTypes.add(nodeType);
    }
236047
public void addPlugin(String name, MoskitoPlugin plugin, PluginConfig config){
		plugins.put(name, plugin);
		try{
			plugin.initialize();
			configs.put(name, config);
		}catch(Exception e){
			log.warn("couldn't initialize plugin "+name+" - "+plugin+", removing", e);
			plugins.remove(name);
		}
	}
1001422
private Node transformNode(
      Node templateNode,
      Map<String, Node> templateNodeToMatchMap,
      Map<String, String> shortNames) {
    Node clone = templateNode.cloneNode();
    if (templateNode.isName()) {
      String name = templateNode.getString();
      if (templateNodeToMatchMap.containsKey(name)) {
        Node templateMatch = templateNodeToMatchMap.get(name);
        Preconditions.checkNotNull(templateMatch, "Match for %s is null", name);
        if (templateNode.getParent().isVar()) {
          // Var declarations should only copy the variable name from the saved match, but the rest
          // of the subtree should come from the template node.
          clone.setString(templateMatch.getString());
        } else {
          return templateMatch.cloneTree();
        }
      }
    } else if (templateNode.isCall()
        && templateNode.getBooleanProp(Node.FREE_CALL)
        && templateNode.getFirstChild().isName()) {
      String name = templateNode.getFirstChild().getString();
      if (templateNodeToMatchMap.containsKey(name)) {
        // If this function call matches a template parameter, don't treat it as a free call.
        // This mirrors the behavior in the TemplateAstMatcher as well as ensures the code
        // generator doesn't generate code like "(0,fn)()".
        clone.putBooleanProp(Node.FREE_CALL, false);
      }
    }
    if (templateNode.isQualifiedName()) {
      String name = templateNode.getQualifiedName();
      if (shortNames.containsKey(name)) {
        String shortName = shortNames.get(name);
        if (!shortName.equals(name)) {
          return IR.name(shortNames.get(name));
        }
      }
    }
    for (Node child : templateNode.children()) {
      clone.addChildToBack(transformNode(child, templateNodeToMatchMap, shortNames));
    }
    return clone;
  }
623976
function getTransformer(name) {
    if (name in transformers) {
      return transformers[name]
    }
    const transformer = toTransformer(name)
    transformers[name] = transformer ? jstransformer(transformer) : false
    return transformers[name]
  }