Package com.microstrategy.web.transform
Class AbstractLayoutSource
- java.lang.Object
-
- com.microstrategy.web.transform.AbstractLayoutSource
-
- All Implemented Interfaces:
LayoutSource
- Direct Known Subclasses:
LayoutSourceFile,LayoutSourceString
public abstract class AbstractLayoutSource extends java.lang.Object implements LayoutSource
This abstract base class manages caching of Layout definitions and provides a simple implementation of LayoutParser.MessageListener- Since:
- MicroStrategy Web 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractLayoutSource.LayoutCacheHintThis class serves as both CacheHint and Cache key.
-
Constructor Summary
Constructors Constructor Description AbstractLayoutSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckNullObject(java.lang.Object o, java.lang.String msg)A utility method to check whether an object is null.protected LayoutTaggetLayout(AbstractLayoutSource.LayoutCacheHint hint)Returns a layout definition from cache based on the cache hint.protected abstract java.lang.StringgetLayoutString(java.lang.String location)Returns the string representation of a layout definition.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.transform.LayoutSource
getDescription, retrieveLayoutDefinition, saveLayoutDefinition
-
-
-
-
Method Detail
-
getLayoutString
protected abstract java.lang.String getLayoutString(java.lang.String location) throws WebTransformExceptionReturns the string representation of a layout definition. The layout cache uses this method to load the layout definition string and then delegates to the layout parser to parse it. The parsed layou definition is cached.- Parameters:
location- the layout location, defined in the StyleCatalog XML file.- Returns:
- the string representation of a layout definition.
- Throws:
WebTransformException- if there is any error while retrieving the layout string
-
getLayout
protected LayoutTag getLayout(AbstractLayoutSource.LayoutCacheHint hint) throws CacheException
Returns a layout definition from cache based on the cache hint.- Parameters:
hint- the cache hint- Returns:
- the layout definition
- Throws:
CacheException- thrown if there is any error retrieving the object from cache or loading the object into cache
-
checkNullObject
protected void checkNullObject(java.lang.Object o, java.lang.String msg)A utility method to check whether an object is null. IllegalArgumentException is thrown if the object is null.- Parameters:
o- the object to checkmsg- the error message used to report error
-
-