/** * Creates the object from a string and log the warnings if any. * This method is for implementation of {@code createFromWKT(String)} method is SIS factories only. * * @param text coordinate system encoded in Well-Known Text format (version 1 or 2). * @return the result of parsing the given text. * @throws FactoryException if the object creation failed. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createFromWKT(String) * @see org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory#createFromWKT(String) */ @Override public final Object createFromWKT(final String text) throws FactoryException { final Object value; try { value = parseObject(text, new ParsePosition(0)); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception.getLocalizedMessage(), exception); } final Warnings warnings = getAndClearWarnings(value); if (warnings != null) { log(new LogRecord(Level.WARNING, warnings.toString())); } return value; }
/** * Creates the object from a string and log the warnings if any. * This method is for implementation of {@code createFromWKT(String)} method is SIS factories only. * * @param text coordinate system encoded in Well-Known Text format (version 1 or 2). * @return the result of parsing the given text. * @throws FactoryException if the object creation failed. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createFromWKT(String) * @see org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory#createFromWKT(String) */ @Override public final Object createFromWKT(final String text) throws FactoryException { final Object value; try { value = parseObject(text, new ParsePosition(0)); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception.getLocalizedMessage(), exception); } final Warnings warnings = getAndClearWarnings(value); if (warnings != null) { log(new LogRecord(Level.WARNING, warnings.toString())); } return value; }