ReferencingParser changes for revisions 25049:25890

The main change in this commit is to rename FactoryFinder as ReferencingFactoryFinder. However this change does not apply to SIS since we do not plan to port [Referencing]FactoryFinder. The plan is to replace them by some dependency injection mechanism.

Likewise, this commit contains a renaming of FactoryGroup class as ReferencingFactoryContainer. This change will not apply to SIS since we plan to avoid that class.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r25049:25890 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/wkt/Parser.java
Revision 25049Revision 25890
import org.opengis.referencing.operation.OperationMethod;

// Geotools dependencies
import org.geotools.metadata.iso.citation.Citations;
import org.geotools.referencing.FactoryFinder;
import org.geotools.referencing.NamedIdentifier;
import org.geotools.referencing.datum.BursaWolfParameters;
import org.geotools.referencing.datum.DefaultGeodeticDatum;
import org.opengis.referencing.operation.OperationMethod;

// Geotools dependencies
import org.geotools.factory.GeoTools;
import org.geotools.factory.Hints;
import org.geotools.metadata.iso.citation.Citations;
import org.geotools.referencing.ReferencingFactoryFinder;
import org.geotools.referencing.NamedIdentifier;
import org.geotools.referencing.datum.BursaWolfParameters;
import org.geotools.referencing.datum.DefaultGeodeticDatum;
import org.geotools.referencing.datum.DefaultVerticalDatum;
import org.geotools.referencing.cs.AbstractCS;
import org.geotools.referencing.cs.DefaultCoordinateSystemAxis;
import org.geotools.referencing.factory.FactoryGroup;
import org.geotools.resources.Arguments;
import org.geotools.resources.i18n.Errors;
import org.geotools.resources.i18n.ErrorKeys;
import org.geotools.referencing.datum.DefaultVerticalDatum;
import org.geotools.referencing.cs.AbstractCS;
import org.geotools.referencing.cs.DefaultCoordinateSystemAxis;
import org.geotools.referencing.factory.ReferencingFactoryContainer;
import org.geotools.resources.Arguments;
import org.geotools.resources.i18n.Errors;
import org.geotools.resources.i18n.ErrorKeys;
 * Set of helper methods working on factories. Will be constructed
 * only the first time it is needed.
 */
private transient FactoryGroup factories;

/**
 * The list of {@linkplain AxisDirection axis directions} from their name.
 * Set of helper methods working on factories. Will be constructed
 * only the first time it is needed.
 */
private transient ReferencingFactoryContainer factories;

/**
 * The list of {@linkplain AxisDirection axis directions} from their name.
 */
public Parser(final Symbols symbols) {
    this(symbols,
         FactoryFinder.getDatumFactory        (null),
         FactoryFinder.getCSFactory           (null),
         FactoryFinder.getCRSFactory          (null),
         FactoryFinder.getMathTransformFactory(null));
}

/**
 */
public Parser(final Symbols symbols) {
    this(symbols,
         ReferencingFactoryFinder.getDatumFactory        (GeoTools.getDefaultHints()),
         ReferencingFactoryFinder.getCSFactory           (GeoTools.getDefaultHints()),
         ReferencingFactoryFinder.getCRSFactory          (GeoTools.getDefaultHints()),
         ReferencingFactoryFinder.getMathTransformFactory(GeoTools.getDefaultHints()));
}

/**
 * @param symbols   The symbols for parsing and formatting numbers.
 * @param factories The factories to use.
 */
public Parser(final Symbols symbols, final FactoryGroup factories) {
    this(symbols,
         factories.getDatumFactory(),
         factories.getCSFactory(),
 * @param symbols   The symbols for parsing and formatting numbers.
 * @param factories The factories to use.
 */
public Parser(final Symbols symbols, final ReferencingFactoryContainer factories) {
    this(symbols,
         factories.getDatumFactory(),
         factories.getCSFactory(),
}
element.close();
if (factories == null) {
    factories = new FactoryGroup(datumFactory, csFactory, crsFactory, mtFactory);
}
return factories.createProjectedCRS(properties, geoCRS, null, projection,
        csFactory.createCartesianCS(properties, axis0, axis1));
}
element.close();
if (factories == null) {
    Map hints = new HashMap();
    hints.put( Hints.DATUM_FACTORY, datumFactory );
    hints.put( Hints.CS_FACTORY, csFactory );
    hints.put( Hints.CRS_FACTORY, crsFactory );
    hints.put( Hints.MATH_TRANSFORM_FACTORY, mtFactory );

    factories = new ReferencingFactoryContainer( new Hints(hints));
}
return factories.createProjectedCRS(properties, geoCRS, null, projection,
        csFactory.createCartesianCS(properties, axis0, axis1));