Package com.gistlabs.mechanize

Examples of com.gistlabs.mechanize.ResourceFactory




    ContentType contentType = getContentType(response);

    ResourceFactory factory = lookupFactory(contentType.getMimeType());
    if (factory == null)
      factory = lookupFactory(ContentType.WILDCARD.getMimeType());

    if (factory == null)
      throw MechanizeExceptionFactory.newMechanizeException("No viable page type found, and no wildcard mime type factory registered.");

    return factory.buildPage(this, request, response);
  }
View Full Code Here


  protected static void processFactoriesClassNames(final List<String> factoryClassNames) {
    for (String factoryClassName : factoryClassNames)
      try {
        @SuppressWarnings("unchecked")
        Class<ResourceFactory> pageFactoryClass = (Class<ResourceFactory>) Class.forName(factoryClassName);
        ResourceFactory pageFactory = pageFactoryClass.newInstance();
        MechanizeAgent.registerFactory(pageFactory);
      } catch (Exception e) {
        // TODO add logging...
        throw MechanizeExceptionFactory.newInitializationException(e);
      }
View Full Code Here

TOP

Related Classes of com.gistlabs.mechanize.ResourceFactory

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.