Flud+ v1.11.1.2版本的 MD5 值为:8801c2f52bfd51902dee3a73c65b73f8

以下内容为反编译后的 RSS090Generator.java 源代码,内容仅作参考


package com.rometools.rome.io.impl;

import com.google.android.material.button.xFZ.MCvbAth;
import com.rometools.rome.feed.WireFeed;
import com.rometools.rome.feed.rss.Channel;
import com.rometools.rome.feed.rss.Image;
import com.rometools.rome.feed.rss.Item;
import com.rometools.rome.feed.rss.TextInput;
import com.rometools.rome.io.FeedException;
import i4.pp.AtBacagCg;
import java.util.List;
import q2.ONq.PxEdByZf;
import q3.dXa.BzpQSKXPiMOtra;
import sa.n;
import sa.o;
import sa.r;
import t6.mQU.uBjNmvkma;
public class RSS090Generator extends BaseWireFeedGenerator {
    private static final String RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    private static final r RDF_NS = r.a("rdf", RDF_URI);
    private static final String RSS_URI = "http://my.netscape.com/rdf/simple/0.9/";
    private static final r RSS_NS = r.a("", RSS_URI);
    private static final String CONTENT_URI = "http://purl.org/rss/1.0/modules/content/";
    private static final r CONTENT_NS = r.a("content", CONTENT_URI);

    public RSS090Generator() {
        this("rss_0.9");
    }

    public RSS090Generator(String str) {
        super(str);
    }

    public void addChannel(Channel channel, o oVar) {
        o oVar2 = new o("channel", getFeedNamespace());
        populateChannel(channel, oVar2);
        checkChannelConstraints(oVar2);
        oVar.h(oVar2);
        generateFeedModules(channel.getModules(), oVar2);
    }

    public void addImage(Channel channel, o oVar) {
        Image image = channel.getImage();
        if (image != null) {
            o oVar2 = new o("image", getFeedNamespace());
            populateImage(image, oVar2);
            checkImageConstraints(oVar2);
            oVar.h(oVar2);
        }
    }

    public void addItem(Item item, o oVar, int i10) {
        o oVar2 = new o("item", getFeedNamespace());
        populateItem(item, oVar2, i10);
        checkItemConstraints(oVar2);
        generateItemModules(item.getModules(), oVar2);
        oVar.h(oVar2);
    }

    public void addItems(Channel channel, o oVar) {
        List<Item> items = channel.getItems();
        for (int i10 = 0; i10 < items.size(); i10++) {
            addItem(items.get(i10), oVar, i10);
        }
        checkItemsConstraints(oVar);
    }

    public void addTextInput(Channel channel, o oVar) {
        TextInput textInput = channel.getTextInput();
        if (textInput != null) {
            o oVar2 = new o(getTextInputLabel(), getFeedNamespace());
            populateTextInput(textInput, oVar2);
            checkTextInputConstraints(oVar2);
            oVar.h(oVar2);
        }
    }

    public void checkChannelConstraints(o oVar) {
        checkNotNullAndLength(oVar, BzpQSKXPiMOtra.XQjC, 0, 40);
        checkNotNullAndLength(oVar, AtBacagCg.PUFOgAoTughzgnq, 0, 500);
        checkNotNullAndLength(oVar, "link", 0, 500);
    }

    public void checkImageConstraints(o oVar) {
        checkNotNullAndLength(oVar, "title", 0, 40);
        checkNotNullAndLength(oVar, "url", 0, 500);
        checkNotNullAndLength(oVar, "link", 0, 500);
    }

    public void checkItemConstraints(o oVar) {
        checkNotNullAndLength(oVar, "title", 0, 100);
        checkNotNullAndLength(oVar, "link", 0, 500);
    }

    public void checkItemsConstraints(o oVar) {
        int size = oVar.s("item", getFeedNamespace()).size();
        if (size < 1 || size > 15) {
            throw new FeedException("Invalid " + getType() + " feed, item count is " + size + " it must be between 1 an 15");
        }
    }

    public void checkLength(o oVar, String str, int i10, int i11) {
        o q10 = oVar.q(str, getFeedNamespace());
        if (q10 != null) {
            if (i10 > 0 && q10.w().length() < i10) {
                throw new FeedException("Invalid " + getType() + " feed, " + oVar.f11579l + " " + str + MCvbAth.InwuyCLUvwwwtUK + i10 + " length");
            } else if (i11 <= -1 || q10.w().length() <= i11) {
            } else {
                throw new FeedException("Invalid " + getType() + " feed, " + oVar.f11579l + " " + str + "exceeds " + i11 + " length");
            }
        }
    }

    public void checkNotNullAndLength(o oVar, String str, int i10, int i11) {
        if (oVar.q(str, getFeedNamespace()) != null) {
            checkLength(oVar, str, i10, i11);
            return;
        }
        throw new FeedException("Invalid " + getType() + " feed, missing " + oVar.f11579l + " " + str);
    }

    public void checkTextInputConstraints(o oVar) {
        checkNotNullAndLength(oVar, "title", 0, 40);
        checkNotNullAndLength(oVar, "description", 0, 100);
        checkNotNullAndLength(oVar, PxEdByZf.HAcQNVqlQMFN, 0, 500);
        checkNotNullAndLength(oVar, "link", 0, 500);
    }

    public n createDocument(o oVar) {
        return new n(oVar);
    }

    public o createRootElement(Channel channel) {
        o oVar = new o("RDF", getRDFNamespace());
        oVar.i(getFeedNamespace());
        oVar.i(getRDFNamespace());
        oVar.i(getContentNamespace());
        generateModuleNamespaceDefs(oVar);
        return oVar;
    }

    @Override
    public n generate(WireFeed wireFeed) {
        Channel channel = (Channel) wireFeed;
        o createRootElement = createRootElement(channel);
        populateFeed(channel, createRootElement);
        BaseWireFeedGenerator.purgeUnusedNamespaceDeclarations(createRootElement);
        return createDocument(createRootElement);
    }

    public o generateSimpleElement(String str, String str2) {
        o oVar = new o(str, getFeedNamespace());
        oVar.e(str2);
        return oVar;
    }

    public r getContentNamespace() {
        return CONTENT_NS;
    }

    public r getFeedNamespace() {
        return RSS_NS;
    }

    public r getRDFNamespace() {
        return RDF_NS;
    }

    public String getTextInputLabel() {
        return "textInput";
    }

    public void populateChannel(Channel channel, o oVar) {
        String title = channel.getTitle();
        if (title != null) {
            oVar.h(generateSimpleElement("title", title));
        }
        String link = channel.getLink();
        if (link != null) {
            oVar.h(generateSimpleElement("link", link));
        }
        String description = channel.getDescription();
        if (description != null) {
            oVar.h(generateSimpleElement("description", description));
        }
    }

    public void populateFeed(Channel channel, o oVar) {
        addChannel(channel, oVar);
        addImage(channel, oVar);
        addTextInput(channel, oVar);
        addItems(channel, oVar);
        generateForeignMarkup(oVar, channel.getForeignMarkup());
    }

    public void populateImage(Image image, o oVar) {
        String title = image.getTitle();
        if (title != null) {
            oVar.h(generateSimpleElement("title", title));
        }
        String url = image.getUrl();
        if (url != null) {
            oVar.h(generateSimpleElement("url", url));
        }
        String link = image.getLink();
        if (link != null) {
            oVar.h(generateSimpleElement("link", link));
        }
    }

    public void populateItem(Item item, o oVar, int i10) {
        String title = item.getTitle();
        if (title != null) {
            oVar.h(generateSimpleElement("title", title));
        }
        String link = item.getLink();
        if (link != null) {
            oVar.h(generateSimpleElement("link", link));
        }
        generateForeignMarkup(oVar, item.getForeignMarkup());
    }

    public void populateTextInput(TextInput textInput, o oVar) {
        String title = textInput.getTitle();
        if (title != null) {
            oVar.h(generateSimpleElement("title", title));
        }
        String description = textInput.getDescription();
        if (description != null) {
            oVar.h(generateSimpleElement(uBjNmvkma.eaSQTNvyeDSQgP, description));
        }
        String name = textInput.getName();
        if (name != null) {
            oVar.h(generateSimpleElement("name", name));
        }
        String link = textInput.getLink();
        if (link != null) {
            oVar.h(generateSimpleElement("link", link));
        }
    }
}