/** TODO: cache this to improve performance? */ public AbstractContextStructureBridge getStructureBridge(Object object) { BridgesExtensionPointReader.initExtensions(); for (Map.Entry<String, AbstractContextStructureBridge> entry : bridges.entrySet()) { // check to see if there is shadowing of content types going on. String shadowsContentType = getShadowedContentType(entry.getKey()); if (shadowsContentType != null) { AbstractContextStructureBridge structureBridge = bridges.get(shadowsContentType); if (structureBridge.acceptsObject(object)) { return structureBridge; } } // no shadowing...look at actual content type AbstractContextStructureBridge bridge = entry.getValue(); if (bridge != null && bridge.acceptsObject(object)) { return bridge; } } // use the default if not found return (defaultBridge != null && defaultBridge.acceptsObject(object)) ? defaultBridge : DEFAULT_BRIDGE; }
public AbstractContextStructureBridge getStructureBridge(String contentType) { BridgesExtensionPointReader.initExtensions(); if (contentType != null) { // find the content type that shadows this one // if one exists. String shadowsContentType = getShadowedContentType(contentType); if (shadowsContentType != null) { AbstractContextStructureBridge bridge = bridges.get(shadowsContentType); if (bridge != null) { return bridge; } } // no shadowing of content, look at original content type AbstractContextStructureBridge bridge = bridges.get(contentType); if (bridge != null) { return bridge; } } return (defaultBridge == null) ? DEFAULT_BRIDGE : defaultBridge; }
public Set<String> getContentTypes() { BridgesExtensionPointReader.initExtensions(); return bridges.keySet(); }
public Map<String, AbstractContextStructureBridge> getStructureBridges() { BridgesExtensionPointReader.initExtensions(); return bridges; }