/**
         * Creates an attribute-value list from an xml document containing restorable state for this layer.
         *
         * @param stateInXml an xml document specified in a {@link String}.
         *
         * @return an attribute-value list containing the parameters in the specified restorable state.
         *
         * @throws ArgumentException if the state reference is null.
         */
        public static AVList wmsRestorableStateToParams(String stateInXml)
        {
            if (stateInXml == null)
            {
                String message = Logging.getMessage("nullValue.StringIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            RestorableSupport rs;

            try
            {
                rs = RestorableSupport.parse(stateInXml);
            }
            catch (Exception e)
            {
                // Parsing the document specified by stateInXml failed.
                String message = Logging.getMessage("generic.ExceptionAttemptingToParseStateXml", stateInXml);
                Logging.logger().severe(message);
                throw new ArgumentException(message, e);
            }

            AVList parameters = new AVListImpl();

            wmsRestoreStateToParams(rs, null, parameters);
            return(parameters);
        }
Exemplo n.º 2
0
        public void restoreState(String stateInXml)
        {
            if (stateInXml == null)
            {
                String message = Logging.getMessage("nullValue.StringIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            RestorableSupport rs;

            try
            {
                rs = RestorableSupport.parse(stateInXml);
            }
            catch (Exception e)
            {
                // Parsing the document specified by stateInXml failed.
                String message = Logging.getMessage("generic.ExceptionAttemptingToParseStateXml", stateInXml);
                Logging.logger().severe(message);
                throw new ArgumentException(message, e);
            }

            this.doRestoreState(rs, null);
        }
Exemplo n.º 3
0
        public WMSBasicElevationModel(String restorableStateInXml)
            : base(wmsRestorableStateToParams(restorableStateInXml))
        {
            RestorableSupport rs;

            try
            {
                rs = RestorableSupport.parse(restorableStateInXml);
            }
            catch (Exception e)
            {
                // Parsing the document specified by stateInXml failed.
                String message = Logging.getMessage("generic.ExceptionAttemptingToParseStateXml", restorableStateInXml);
                Logging.logger().severe(message);
                throw new ArgumentException(message, e);
            }

            this.doRestoreState(rs, null);
        }
        public WMSTiledImageLayer(String stateInXml)
        {
            this(wmsRestorableStateToParams(stateInXml));

            RestorableSupport rs;

            try
            {
                rs = RestorableSupport.parse(stateInXml);
            }
            catch (Exception e)
            {
                // Parsing the document specified by stateInXml failed.
                String message = Logging.getMessage("generic.ExceptionAttemptingToParseStateXml", stateInXml);
                Logging.logger().severe(message);
                throw new ArgumentException(message, e);
            }

            this.doRestoreState(rs, null);
        }