@Override public Object parse( ParsingEngine parsingEngine, ArgumentSource source, Type type, ArgumentMatches matches ) { ArgumentDefinition definition = createDefaultArgumentDefinition(source); String fileName = getArgumentValue( definition, matches ).asString(); // This parser has been passed a null filename and the GATK is not responsible for creating a type default for the object; // therefore, the user must have failed to specify a type default if(fileName == null && source.isRequired()) throw new MissingArgumentValueException(definition); OutputStreamStub stub = new OutputStreamStub(new File(fileName)); engine.addOutput(stub); Object result = createInstanceOfClass(makeRawTypeIfNecessary(type),stub); // WARNING: Side effects required by engine! parsingEngine.addTags(result,getArgumentTags(matches)); return result; }