All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.helger.ebinterface.builder.EbInterfaceReader Maven / Gradle / Ivy

There is a newer version: 7.1.0
Show newest version
/**
 * Copyright (C) 2014-2020 Philip Helger (www.helger.com)
 * philip[at]helger[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.helger.ebinterface.builder;

import javax.annotation.Nonnull;
import javax.annotation.concurrent.NotThreadSafe;

import com.helger.ebinterface.v30.Ebi30InvoiceType;
import com.helger.ebinterface.v302.Ebi302InvoiceType;
import com.helger.ebinterface.v40.Ebi40InvoiceType;
import com.helger.ebinterface.v41.Ebi41InvoiceType;
import com.helger.ebinterface.v42.Ebi42InvoiceType;
import com.helger.ebinterface.v43.Ebi43InvoiceType;
import com.helger.ebinterface.v50.Ebi50InvoiceType;
import com.helger.ebinterface.v60.Ebi60InvoiceType;
import com.helger.jaxb.builder.JAXBReaderBuilder;

/**
 * A reader builder for ebInterface documents.
 *
 * @author Philip Helger
 * @param 
 *        The ebInterface implementation class to be read
 */
@NotThreadSafe
public class EbInterfaceReader  extends JAXBReaderBuilder >
{
  public EbInterfaceReader (@Nonnull final EEbInterfaceDocumentType eDocType,
                            @Nonnull final Class  aImplClass)
  {
    super (eDocType, aImplClass);
  }

  public EbInterfaceReader (@Nonnull final Class  aClass)
  {
    this (EbInterfaceDocumentTypes.getDocumentTypeOfImplementationClass (aClass), aClass);
  }

  /**
   * Create a new reader builder.
   *
   * @param aClass
   *        The UBL class to be read. May not be null.
   * @return The new reader builder. Never null.
   * @param 
   *        The ebInterface document implementation type
   */
  @Nonnull
  public static  EbInterfaceReader  create (@Nonnull final Class  aClass)
  {
    return new EbInterfaceReader <> (aClass);
  }

  /**
   * Create a new reader builder that is not typed, because only the document
   * type enumeration value is available.
   *
   * @param eDocType
   *        The ebInterface document type to be read. May not be
   *        null .
   * @return The new reader builder. Never null.
   */
  @Nonnull
  public static EbInterfaceReader  createGeneric (@Nonnull final EEbInterfaceDocumentType eDocType)
  {
    return new EbInterfaceReader <> (eDocType, Object.class);
  }

  /**
   * Create a reader builder for Ebi30InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface30 ()
  {
    return EbInterfaceReader.create (Ebi30InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi302InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface302 ()
  {
    return EbInterfaceReader.create (Ebi302InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi40InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface40 ()
  {
    return EbInterfaceReader.create (Ebi40InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi41InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface41 ()
  {
    return EbInterfaceReader.create (Ebi41InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi42InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface42 ()
  {
    return EbInterfaceReader.create (Ebi42InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi43InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface43 ()
  {
    return EbInterfaceReader.create (Ebi43InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi50InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface50 ()
  {
    return EbInterfaceReader.create (Ebi50InvoiceType.class);
  }

  /**
   * Create a reader builder for Ebi60InvoiceType.
   *
   * @return The builder and never null
   */
  @Nonnull
  public static EbInterfaceReader  ebInterface60 ()
  {
    return EbInterfaceReader.create (Ebi60InvoiceType.class);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy