Search in sources :

Example 1 with ResourceSnippet

use of lucee.commons.io.res.util.ResourceSnippet in project Lucee by lucee.

the class DebugEntryTemplatePartComparator method getEntry.

@Override
public DebugEntryTemplatePart getEntry(PageContext pc, PageSource source, int startPos, int endPos) {
    String src = DebugEntryTemplatePartImpl.getSrc(source == null ? "" : source.getDisplayPath(), startPos, endPos);
    DebugEntryTemplatePartImpl de = null;
    if (partEntries != null) {
        de = partEntries.get(src);
        if (de != null) {
            de.countPP();
            return de;
        }
    } else {
        partEntries = new HashMap<String, DebugEntryTemplatePartImpl>();
    }
    ResourceSnippet snippet = snippetsMap.getSnippet(source, startPos, endPos, ((PageContextImpl) pc).getResourceCharset().name());
    de = new DebugEntryTemplatePartImpl(source, startPos, endPos, snippet.getStartLine(), snippet.getEndLine(), snippet.getContent());
    partEntries.put(src, de);
    return de;
}
Also used : ResourceSnippet(lucee.commons.io.res.util.ResourceSnippet) PageContextImpl(lucee.runtime.PageContextImpl)

Aggregations

ResourceSnippet (lucee.commons.io.res.util.ResourceSnippet)1 PageContextImpl (lucee.runtime.PageContextImpl)1