Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.DataConfiguration


    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertSenseiQuery(list, senseiQuery);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertSenseiQuery(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here


    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertPartitionParams(list, partitions);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertPartitionParams(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    bRequest.addSelections(selections);
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertSelectionNames(list, bRequest);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertSelectParam(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

      logger.warn("Old client or json error", jse);

      // Fall back to the old REST API.  In the future, we should
      // consider reporting JSON exceptions here.
      requestContext.senseiReq = DefaultSenseiJSONServlet.convertSenseiRequest(
                    new DataConfiguration(new MapConfiguration(getParameters(requestContext.content))));
      requestContext.query = requestContext.content;
    }
    return requestContext;
  }
View Full Code Here

  abstract protected SenseiRequest buildSenseiRequest(DataConfiguration params) throws Exception;
 
  @Override
  protected SenseiRequest buildSenseiRequest(HttpServletRequest req)
      throws Exception {
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(req));
    return buildSenseiRequest(params);
  }
View Full Code Here

        case PROPERTIES:
          url = getResourceAsURL(resource + ".properties");

          if (url != null) {
            result = new DataConfiguration(new PropertiesConfiguration(url));
          }

          break;

        case XML:
          url = getResourceAsURL(resource + ".xml");

          if (url != null) {
            result = new DataConfiguration(new XMLConfiguration(url));
          }

          break;

        default:
View Full Code Here

        case PROPERTIES:
          url = getResourceAsURL(resource + ".properties");

          if (url != null) {
            result = new DataConfiguration(new PropertiesConfiguration(url));
          }

          break;

        case XML:
          url = getResourceAsURL(resource + ".xml");

          if (url != null) {
            result = new DataConfiguration(new XMLConfiguration(url));
          }

          break;

        default:
View Full Code Here

  @SuppressWarnings("unchecked")
  public Object getValue(String prefix, String key, Field field, Configuration configuration) throws Exception {
    Object value;

    try {
      value = new DataConfiguration(configuration).get(ClassUtils.primitiveToWrapper(field.getType()), prefix
          + key);

    } catch (ConversionException cause) {
      throw cause;
    }
View Full Code Here

@Priority(L2_PRIORITY)
public class ConfigurationArrayValueExtractor implements ConfigurationValueExtractor {

  @Override
  public Object getValue(String prefix, String key, Field field, Configuration configuration) throws Exception {
    return new DataConfiguration(configuration).getArray(field.getType().getComponentType(), prefix + key);
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.DataConfiguration

Copyright © 2018 www.massapicom. 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.