private static final TreeReader getReader(String format, boolean throwException) {
		TreeReader reader;
		if (format == null) {
			reader = cachedJsonReader;
		} else {
			String key = format.toLowerCase();
			if (JSON.equals(key)) {
				reader = cachedJsonReader;
			} else {
				reader = readers.get(key);
			}
		}
		if (reader != null) {
			return reader;
		}

		// Search reader class by system property:
		//
		// -Ddatatree.json.reader=io.datatree.adapters.JsonBoon
		// -Ddatatree.xml.reader=io.datatree.adapters.XmlJackson
		// -Ddatatree.yaml.reader=your.yaml.reader.ClassName
		// -Ddatatree.csv.reader=your.csv.reader.ClassName
		// -Ddatatree.properties.reader=your.properties.reader.ClassName
		//
		// ...or to use your "custom" format:
		//
		// -Ddatatree.custom.reader=your.custom.reader.ClassName
		// Tree node = new Tree(source, "custom");
		//
		String propertyName = "datatree." + format + ".reader";
		try {
			String className = System.getProperty(propertyName);
			if (className == null || className.isEmpty()) {
				className = PackageScanner.findByFormat(format, true);
			}
			if (className == null || className.isEmpty()) {
				throw new IllegalArgumentException("System Property \"" + propertyName + "\" not found! "
						+ "This property defines a custom reader class for the \"" + format + "\" format.");
			}
			reader = (TreeReader) Class.forName(className).newInstance();
			readers.put(format, reader);
			return reader;
		} catch (Throwable cause) {
			if (throwException) {
				suggestDependency(format);
				cause.printStackTrace();
				throw new IllegalArgumentException("Unable to create reader for format \"" + format + "\"! Set the -D"
						+ propertyName + "=package.ReaderClass initial parameter to specify the proper reader class.",
						cause);
			}
		}
		return new JsonBuiltin();
	}
private static final TreeReader getReader ( String format , boolean throwException ) { TreeReader reader ; if ( format == null ) { reader = cachedJsonReader ; } else { String key = format . toLowerCase ( ) ; if ( JSON . equals ( key ) ) { reader = cachedJsonReader ; } else { reader = readers . get ( key ) ; } } if ( reader != null ) { return reader ; } String propertyName = "datatree." + format + ".reader" ; try { String className = System . getProperty ( propertyName ) ; if ( className == null || className . isEmpty ( ) ) { className = PackageScanner . findByFormat ( format , true ) ; } if ( className == null || className . isEmpty ( ) ) { throw new IllegalArgumentException ( "System Property \"" + propertyName + "\" not found! " + "This property defines a custom reader class for the \"" + format + "\" format." ) ; } reader = ( TreeReader ) Class . forName ( className ) . newInstance ( ) ; readers . put ( format , reader ) ; return reader ; } catch ( Throwable cause ) { if ( throwException ) { suggestDependency ( format ) ; cause . printStackTrace ( ) ; throw new IllegalArgumentException ( "Unable to create reader for format \"" + format + "\"! Set the -D" + propertyName + "=package.ReaderClass initial parameter to specify the proper reader class." , cause ) ; } } return new JsonBuiltin ( ) ; }
--- FACTORY FINDER METHOD ---