Examples of LiteralPPIO


Examples of org.geoserver.wps.ppio.LiteralPPIO

                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
          
            //handle the literal case
            if ( ppios.size() == 1 && ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralInputType literal = wpsf.createLiteralInputType();
                input.setLiteralData( literal );
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                    Name typeName = xsp.name( lppio.getType() );
                    if ( typeName != null ) {
                        literal.setDataType( Ows11Util.type( typeName.getLocalPart() ) );       
                    }   
                }
                literal.setAnyValue( owsf.createAnyValueType() );
View Full Code Here

Examples of org.geoserver.wps.ppio.LiteralPPIO

                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
           
            //handle the literal case
            if ( ppios.size() == 1 && ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralOutputType literal = wpsf.createLiteralOutputType();
                output.setLiteralOutput(literal);
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                    Name typeName = xsp.name( lppio.getType() );
                    if ( typeName != null ) {
                        literal.setDataType( Ows11Util.type( typeName.getLocalPart() ) );       
                    }   
                }
            }
View Full Code Here

Examples of org.geoserver.wps.ppio.LiteralPPIO

                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
          
            //handle the literal case
            if (ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralInputType literal = wpsf.createLiteralInputType();
                input.setLiteralData( literal );
               
                // map the java class to an xml type name
                if ( !String.class.equals(lppio.getType()) ) {
                  Class type = lppio.getType();
                  if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
                    type = PRIMITIVE_TO_WRAPPER.get(type);
                  }
                    Name typeName = xsp.name(type);
                    if ( typeName != null ) {
                        literal.setDataType(Ows11Util.type("xs:" + typeName.getLocalPart()));       
                    }   
                }
                if(lppio.getType().isEnum()) {
                  Object[] enumValues = lppio.getType().getEnumConstants();
                  AllowedValuesType allowed = owsf.createAllowedValuesType();
                  for (Object value : enumValues) {
                    ValueType vt = owsf.createValueType();
                    vt.setValue(value.toString());
            allowed.getValue().add(vt);
View Full Code Here

Examples of org.geoserver.wps.ppio.LiteralPPIO

                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
           
            //handle the literal case
            if ( ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralOutputType literal = wpsf.createLiteralOutputType();
                output.setLiteralOutput(literal);
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                  Class type = lppio.getType();
                  if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
                    type = PRIMITIVE_TO_WRAPPER.get(type);
                  }
                    Name typeName = xsp.name(type);
                    if ( typeName != null ) {
View Full Code Here

Examples of org.geoserver.wps.ppio.LiteralPPIO

                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
          
            //handle the literal case
            if (ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralInputType literal = wpsf.createLiteralInputType();
                input.setLiteralData( literal );
               
                // map the java class to an xml type name
                if ( !String.class.equals(lppio.getType()) ) {
                  Class type = lppio.getType();
                  if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
                    type = PRIMITIVE_TO_WRAPPER.get(type);
                  }
                    Name typeName = xsp.name(type);
                    if ( typeName != null ) {
                        literal.setDataType(Ows11Util.type("xs:" + typeName.getLocalPart()));       
                    }   
                }
                if (p.metadata.get(Parameter.OPTIONS) != null) {
                    List<Object> options = (List<Object>) p.metadata.get(Parameter.OPTIONS);
                    Object[] optionsArray = options.toArray(new Object[options.size()]);
                    addAllowedValues(literal, optionsArray);
                } else if (lppio.getType().isEnum()) {
                  Object[] enumValues = lppio.getType().getEnumConstants();
                    addAllowedValues(literal, enumValues);
                } else {
                  literal.setAnyValue( owsf.createAnyValueType() );
                }

                try {
                    if (p.sample != null) {
                        literal.setDefaultValue(lppio.encode(p.sample));
                    }
                } catch (Exception e) {
                    LOGGER.log(Level.WARNING, "Failed to fill the default value for input " + p.key
                            + " of process " + name, e);
                }
View Full Code Here

Examples of org.geoserver.wps.ppio.LiteralPPIO

                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
           
            //handle the literal case
            if ( ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralOutputType literal = wpsf.createLiteralOutputType();
                output.setLiteralOutput(literal);
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                  Class type = lppio.getType();
                  if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
                    type = PRIMITIVE_TO_WRAPPER.get(type);
                  }
                    Name typeName = xsp.name(type);
                    if ( typeName != null ) {
View Full Code Here

Examples of org.geoserver.wps.ppio.LiteralPPIO

        // enum special treatment
        if (p.type.isEnum()) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "Trying to find the PPIO for the Enum = " + p.type);
            }
            return new LiteralPPIO(p.type);
        }

        // TODO: come up with some way to flag one as "default"
        List<ProcessParameterIO> all = ProcessParameterIO.findAll(p, context);
        if (all.isEmpty()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.