Package org.verapdf.tools
Class StaticResources
- java.lang.Object
-
- org.verapdf.tools.StaticResources
-
public class StaticResources extends Object
Class handles static resources that need to be reset with each parsing of document.- Author:
- Sergey Shemyakov
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcacheCMap(String name, CMap cMap)Caches CMap object.static voidcacheFontProgram(String key, FontProgram font)static voidcacheStructureNameSpace(PDStructureNameSpace nameSpace)Caches structure name space.static voidclear()Clears all cached static resources.static FontProgramgetCachedFont(String key)static Map<String,FontProgram>getCachedFonts()static CMapgetCMap(String name)Gets CMap for this string key.static Map<String,CMap>getcMapCache()static PDStructureNameSpacegetStructureNameSpace(COSKey key)Gets cached pd structure name space.static Map<COSKey,PDStructureNameSpace>getStructureNameSpaceCache()static voidsetCachedFonts(Map<String,FontProgram> cachedFonts)static voidsetcMapCache(Map<String,CMap> cMapCache)static voidsetStructureNameSpaceCache(Map<COSKey,PDStructureNameSpace> structureNameSpaceCache)
-
-
-
Method Detail
-
cacheCMap
public static void cacheCMap(String name, CMap cMap)
Caches CMap object.- Parameters:
name- is string key for cached CMap.cMap- is CMap object for caching.
-
getCMap
public static CMap getCMap(String name)
Gets CMap for this string key.- Parameters:
name- is key for CMap.- Returns:
- cached CMap with this name or null if no CMap available.
-
cacheStructureNameSpace
public static void cacheStructureNameSpace(PDStructureNameSpace nameSpace)
Caches structure name space. Key is chosen to be indirect reference key of this namespace dictionary.- Parameters:
nameSpace- is PD structure name space to cache.
-
getStructureNameSpace
public static PDStructureNameSpace getStructureNameSpace(COSKey key)
Gets cached pd structure name space.- Parameters:
key- is COSKey of namespace to get.- Returns:
- cached namespace with this COSKey or null if no namespace available.
-
cacheFontProgram
public static void cacheFontProgram(String key, FontProgram font)
-
getCachedFont
public static FontProgram getCachedFont(String key)
-
clear
public static void clear()
Clears all cached static resources.
-
getStructureNameSpaceCache
public static Map<COSKey,PDStructureNameSpace> getStructureNameSpaceCache()
-
setStructureNameSpaceCache
public static void setStructureNameSpaceCache(Map<COSKey,PDStructureNameSpace> structureNameSpaceCache)
-
getCachedFonts
public static Map<String,FontProgram> getCachedFonts()
-
setCachedFonts
public static void setCachedFonts(Map<String,FontProgram> cachedFonts)
-
-