package com.l7tech.xml.xslt;

import com.l7tech.message.XmlKnob;
import com.l7tech.util.Functions.Unary;
import java.io.Closeable;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;

public class TransformInput implements Closeable {
   private final Unary<Object, String> a;
   private final XmlKnob b;
   @Nullable
   private final Closeable c;

   public TransformInput(XmlKnob var1, @Nullable Closeable var2, Unary<Object, String> var3) {
      if (var1 == null) {
         throw new NullPointerException();
      }

      this.a = var3;
      this.b = var1;
      this.c = var2;
   }

   public Object getVariableValue(String var1) {
      try {
         if (this.a == null) {
            return null;
         }
      } catch (NullPointerException var2) {
         throw a(var2);
      }

      return this.a.call(var1);
   }

   public Unary<Object, String> getVariableGetter() {
      return this.a;
   }

   public XmlKnob getXmlKnob() {
      return this.b;
   }

   @Override
   public void close() throws IOException {
      try {
         if (this.c != null) {
            this.c.close();
         }
      } catch (IOException var1) {
         throw a(var1);
      }
   }

   private static Exception a(Exception var0) {
      return var0;
   }
}
