RawBuilder.java 1.63 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text;

import com.adobe.xfa.text.DispLineRaw;
import com.adobe.xfa.text.DispRaw;
import com.adobe.xfa.text.FormatInfo;
import com.adobe.xfa.text.PosnStack;
import com.adobe.xfa.text.RawProcessor;
import com.adobe.xfa.text.TextAttr;
import com.adobe.xfa.text.TextEmbed;
import com.adobe.xfa.text.TextPosnBase;

class RawBuilder
extends DispRaw {
    private final RawProcessor moProcessor;

    RawBuilder(FormatInfo oFormatInfo, DispLineRaw poLine) {
        super(oFormatInfo, oFormatInfo.posnStack());
        this.moProcessor = new RawProcessor(oFormatInfo, poLine, this.getPosition(), oFormatInfo.resolveAttr(oFormatInfo.getAttr()));
    }

    void finish() {
        this.moProcessor.finish(this.isLastParaLine(), this.isLastLineInStream());
    }

    @Override
    protected boolean onAttr() {
        this.moProcessor.processAttr(this.getPosition().nextAttr());
        return true;
    }

    @Override
    protected boolean onChar(int c, int eBreak) {
        this.moProcessor.processChar(c, eBreak, this.getPosition());
        return false;
    }

    @Override
    protected boolean onObject() {
        this.moProcessor.processObject(this.getPosition().nextEmbed(), this.getPosition());
        return true;
    }

    @Override
    protected boolean onPara() {
        this.moProcessor.processPara(this.getPosition());
        return false;
    }

    @Override
    protected void onStreamStart() {
        this.moProcessor.processStreamStart(this.getPosition());
    }

    @Override
    protected void onStreamEnd() {
        this.moProcessor.processStreamEnd(this.getPosition());
    }
}