Create a logical transform for applying a named transform.
<p>
This transform can represent applying any named transform.

@param name the transform name
@param args expression arguments to the transform
@return a logical transform
558537
public Transform apply(String name, Expression... args) {
    return LogicalExpressions.apply(name,
        JavaConverters.asScalaBuffer(Arrays.asList(args)).toSeq());
  }
1345980
public static <T> Observable.Transformer<T, T> applyLogging(final String name, final Logger logger){
        return new Observable.Transformer<T, T>() {
            @Override
            public Observable<T> call(Observable<T> observable) {
                return observable
                        .doOnNext(new Action1<T>() {
                            @Override
                            public void call(T t) {
                                logger.log(Log.DEBUG, "[%s] onNext(%s)", name, t);
                            }
                        })
                        .doOnError(new Action1<Throwable>() {
                            @Override
                            public void call(Throwable throwable) {
                                logger.log(throwable, Log.DEBUG, "[%s] onError()", name);
                            }
                        })
                        .doOnCompleted(new Action0() {
                            @Override
                            public void call() {
                                logger.log(Log.DEBUG, "[%s] onCompleted()", name);
                            }
                        });
            }
        };
    }
497311
public static void instanceOf(final Object arg, final Class<?> clazz, final String name) {
        
        if(arg == null) {
            throw new IllegalArgumentException(String.format("%s should not be null.", name));
        }
        
        if(!clazz.isAssignableFrom(arg.getClass())) {
            throw new IllegalArgumentException(String.format("%s should not be class with '%s'.", name, clazz.getName()));
        }
        
    }
343697
public void transform(String name, String transform) throws Exception {

        File configFile = new File(m_configDir, name);
        File transformFile = new File(m_xsltDir, transform);
        try (InputStream stream = new FileInputStream(transformFile)) {
            StreamSource source = new StreamSource(stream);
            transform(configFile, source);
        }
    }
163074
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setName(final String name) {
        pathBuilder.setName(name);
        return (T) this;
    }
803733
public static void main(String[] args) {
        //Adding custom equivalence class generation transformer - NOTE this will get applied during graph traversal-->
        //MODEL USAGE EXAMPLE: <assign name="var_out_V1_2" expr="%ssn"/> <dg:transform name="EQ"/>
        Map<String, DataTransformer> transformers = new HashMap<String, DataTransformer>();
        transformers.put("EQ", new EquivalenceClassTransformer());
        Vector<CustomTagExtension> cte = new Vector<CustomTagExtension>();
        cte.add(new InLineTransformerExtension(transformers));
        Engine engine = new SCXMLEngine(cte);

        //will default to samplemachine, but you could specify a different file if you choose to
        InputStream is = CmdLine.class.getResourceAsStream("/" + (args.length == 0 ? "samplemachine" : args[0]) + ".xml");

        engine.setModelByInputFileStream(is);

        // Usually, this should be more than the number of threads you intend to run
        engine.setBootstrapMin(1);

        //Prepare the consumer with the proper writer and transformer
        DataConsumer consumer = new DataConsumer();
        consumer.addDataTransformer(new SampleMachineTransformer());

        //Adding custom equivalence class generation transformer - NOTE this will get applied post data generation.
        //MODEL USAGE EXAMPLE: <dg:assign name="var_out_V2" set="%regex([0-9]{3}[A-Z0-9]{5})"/>
        consumer.addDataTransformer(new EquivalenceClassTransformer());

        consumer.addDataWriter(new DefaultWriter(System.out,
                new String[]{"var_1_1", "var_1_2", "var_1_3", "var_1_4", "var_1_5", "var_1_6", "var_1_7",
                             "var_2_1", "var_2_2", "var_2_3", "var_2_4", "var_2_5", "var_2_6", "var_2_7", "var_2_8"}));

        //Prepare the distributor
        DefaultDistributor defaultDistributor = new DefaultDistributor();
        defaultDistributor.setThreadCount(1);
        defaultDistributor.setDataConsumer(consumer);
        Logger.getLogger("org.apache").setLevel(Level.WARN);

        engine.process(defaultDistributor);
    }
102398
public static String toJavaIdentifierForm( String name )
    {
        if (isBlank(name)) {
            throw new IllegalArgumentException("The specification mapping can't be null or empty");
        }
        return removeNonJavaIdentifierCharacters( removeDiacritics( toLowerCamelCase( name ) ) );
    }
1117245
public static IRMethodCallExpressionBuilder call( String name, IRExpressionBuilder... args ) {
    return call( _this(), name, args );
  }
1017188
public final void addArgument(final String name, final Object value) {
        if (name == null) {
            throw new IllegalArgumentException("The argument 'name' cannot be null!");
        }
        if (value == null) {
            throw new IllegalArgumentException("The argument 'value' cannot be null!");
        }
        arguments.put(name.trim(), value);
    }
220720
public Pattern<T, T> notNext(final String name) {
		if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
			throw new UnsupportedOperationException(
					"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
					"You can simulate such pattern with two independent patterns, one with and the other without " +
					"the optional part.");
		}
		return new Pattern<>(name, this, ConsumingStrategy.NOT_NEXT, afterMatchSkipStrategy);
	}
1206700
public static transformaction get(nitro_service service, String name) throws Exception{
		transformaction obj = new transformaction();
		obj.set_name(name);
		transformaction response = (transformaction) obj.get_resource(service);
		return response;
	}
1036546
private static boolean isNamed(String funcName, Argument[] args) throws TransformerException {
	if (ArrayUtil.isEmpty(args)) return false;
	boolean named = false;
	for (int i = 0; i < args.length; i++) {
	    if (args[i] instanceof NamedArgument) named = true;
	    else if (named) throw new TransformerException("invalid argument for function " + funcName + ", you can not mix named and unnamed arguments", args[i].getStart());
	}

	return named;
    }
1227982
private static Pattern compileAssignPattern(String name) {
        return Pattern.compile(
                String.format("\\b(__)?%s(__)?\\b *= *(['\"]+)(.*?)\\3", name),
                REGEX_OPTIONS);
    }
630990
public CmdLineAction arg(String arg) {
		if (!CmdLineProcessor.isActionArg(arg)) {
			throw new IllegalArgumentException(arg);
		}
		this.args.add(arg);
		return this;
	}
86029
@Override
	public T convert(String name) throws IllegalArgumentException {
		if (name == null) {
			throw new IllegalArgumentException("Cant convert 'null' to " + enumClass.getSimpleName());
		}
		try {
			return Enum.valueOf(enumClass, name);
		} catch (IllegalArgumentException e) {
			// ignore
		}
		try {
			return Enum.valueOf(enumClass, name.toUpperCase());
		} catch (IllegalArgumentException e) {
			// ignore
		}
		try {
			return Enum.valueOf(enumClass, name.toUpperCase().replace("-", "_"));
		} catch (IllegalArgumentException e) {
			// ignore
		}
		throw new IllegalArgumentException("Can't convert " + name + " to " + enumClass.getSimpleName());

	}
582309
public static <T> Parser<T> expect(final String name) {
    return new Parser<T>() {
      @Override boolean apply(ParseContext ctxt) {
        ctxt.expected(name);
        return false;
      }
      
      @Override public String toString() {
        return name;
      }
    };
  }
485153
public ProcessBuilder processBuilder(String... arguments) {
		ProcessBuilder processBuilder = new ProcessBuilder(toString());
		processBuilder.command().addAll(Arrays.asList(arguments));
		return processBuilder;
	}