ro.isdc.wro.model.factory
Class XmlModelFactory

java.lang.Object
  extended by ro.isdc.wro.model.factory.AbstractWroModelFactory
      extended by ro.isdc.wro.model.factory.XmlModelFactory
All Implemented Interfaces:
WroModelFactory, ObjectFactory<WroModel>

public class XmlModelFactory
extends AbstractWroModelFactory

Model factory implementation. Creates a WroModel object, based on an xml. This xml contains the description of all groups.

This class is thread-safe (the create method is synchronized).

Author:
Alex Objelean

Field Summary
static String ALIAS
          The alias for this model factory used by spi provider.
 
Constructor Summary
XmlModelFactory()
          Default constructor.
 
Method Summary
 WroModel create()
          
protected  String getDefaultModelFilename()
          
 XmlModelFactory setValidateXml(boolean validateXml)
          Allows disable the xml validation (which is true by default.
 
Methods inherited from class ro.isdc.wro.model.factory.AbstractWroModelFactory
destroy, getModelResourceAsStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS

public static final String ALIAS
The alias for this model factory used by spi provider.

See Also:
Constant Field Values
Constructor Detail

XmlModelFactory

public XmlModelFactory()
Default constructor.

Method Detail

create

public WroModel create()


getDefaultModelFilename

protected String getDefaultModelFilename()

Specified by:
getDefaultModelFilename in class AbstractWroModelFactory
Returns:
the default name of the file describing the wro model.

setValidateXml

public XmlModelFactory setValidateXml(boolean validateXml)
Allows disable the xml validation (which is true by default. Be aware that this is not a good idea to disable validation, because you cannot be sure that the model is built correctly. Disabling makes sense only when for some reason the xsd schema cannot be loaded on some environments. An example of issue can be found here:
Wro4j doesn't work on Websphere with 2 or more wars



Copyright © 2008-2013. All Rights Reserved.