Class TransformedAuthorityFactory

    • Constructor Detail

      • TransformedAuthorityFactory

        protected TransformedAuthorityFactory​(AuthorityFactory factory)
        Creates a wrapper around the specified factory.
        Parameters:
        factory - The factory to wrap.
      • TransformedAuthorityFactory

        protected TransformedAuthorityFactory​(String authority,
                                              Hints userHints)
                                       throws FactoryRegistryException
        Creates a wrappers around the default factories for the specified authority. The factories are fetched using ReferencingFactoryFinder.
        Parameters:
        authority - The authority to wraps (example: "EPSG"). If null, then all authority factories must be explicitly specified in the set of hints.
        userHints - An optional set of hints, or null if none.
        Throws:
        FactoryRegistryException - if at least one factory can not be obtained.
        Since:
        2.4
    • Method Detail

      • getPriority

        public int getPriority()
        Returns the priority for this factory. Priorities are used by ReferencingFactoryFinder for selecting a preferred factory when many are found for the same service. The default implementation returns priority + 1, which implies that this adapter has precedence over the wrapped factories. Subclasses should override this method if they want a different priority order for this instance.
        Overrides:
        getPriority in class AbstractFactory
      • replace

        protected Unit<?> replace​(Unit<?> units)
                           throws FactoryException
        Replaces the specified unit, if applicable. This method is invoked automatically by the replace(CoordinateSystem) method. The default implementation returns the unit unchanged.
        Parameters:
        units - The units to replace.
        Returns:
        The new units, or units if no change were needed.
        Throws:
        FactoryException - if an error occured while creating the new units.
      • replace

        protected AxisDirection replace​(AxisDirection direction)
                                 throws FactoryException
        Replaces the specified direction, if applicable. This method is invoked automatically by the replace(CoordinateSystem) method. The default implementation returns the axis direction unchanged.
        Parameters:
        direction - The axis direction to replace.
        Returns:
        The new direction, or direction if no change were needed.
        Throws:
        FactoryException - if an error occured while creating the new axis direction.
      • replace

        protected CoordinateSystem replace​(CoordinateSystem cs)
                                    throws FactoryException
        Replaces (if needed) the specified coordinate system by a new one. The default implementation invokes replace for each axis. In addition, axis are sorted if this factory implements the Comparator interface.
        Parameters:
        cs - The coordinate system to replace.
        Returns:
        The new coordinate system, or cs if no change were needed.
        Throws:
        FactoryException - if an error occured while creating the new coordinate system.
      • replace

        protected Datum replace​(Datum datum)
                         throws FactoryException
        Replaces (if needed) the specified datum by a new one. The default implementation returns the datum unchanged. Subclasses should override this method if some datum replacements are desired.
        Parameters:
        datum - The datum to replace.
        Returns:
        The new datum, or datum if no change were needed.
        Throws:
        FactoryException - if an error occured while creating the new datum.
      • replace

        protected CoordinateOperation replace​(CoordinateOperation operation)
                                       throws FactoryException
        Replaces (if needed) the specified coordinate operation. The default implementation checks if there is a source or target CRS replacement. If there is at least one of those, then this method returns a new coordinate operation using the new CRS.
        Parameters:
        operation - The coordinate operation to replace.
        Returns:
        A new operation, or operation if no change were needed.
        Throws:
        FactoryException - if an error occured while creating the new operation object.
      • dispose

        public void dispose()
                     throws FactoryException
        Releases resources immediately instead of waiting for the garbage collector. This method do not dispose the resources of wrapped factories (e.g. crsFactory), because they may still in use by other classes.
        Overrides:
        dispose in class AuthorityFactoryAdapter
        Throws:
        FactoryException - if an error occured while disposing the factory.