Class ProductVariantRuntimeHelper

java.lang.Object
org.faktorips.runtime.internal.productvariant.ProductVariantRuntimeHelper

public class ProductVariantRuntimeHelper extends Object
Helper class for loading product variants or varied product components respectively.
Author:
Stefan Widmaier, FaktorZehn AG
  • Field Details

  • Constructor Details

    • ProductVariantRuntimeHelper

      public ProductVariantRuntimeHelper()
  • Method Details

    • initProductComponentVariation

      public void initProductComponentVariation(ProductComponent originalProductComponent, ProductComponent productComponentToBeInitialized, Element prodCmptElement)
      The given product component is initialized with the data of the original product component and the variations defined by the variant.
      Parameters:
      originalProductComponent - the original product component that provides default values
      productComponentToBeInitialized - the yet un-initialized product component.
      prodCmptElement - the XML element containing product component's variation data.
    • initProductComponentGenerationVariation

      public IProductComponentGeneration initProductComponentGenerationVariation(IRuntimeRepository runtimeRepository, GenerationTocEntry tocEntry, Element genElement)
      The given generation is initialized with the data of the original product component generation and the variations defined by the variant.
      Parameters:
      runtimeRepository - the runtime repository calling this method. It will be used to load the original product component.
      tocEntry - the GenerationTocEntry for the requested ProductComponentGeneration
      genElement - the XML element containing the variation of a product component generation.
    • createNewInstance

      protected ProductComponentGeneration createNewInstance(ProductComponentGeneration generationTemplate, ProductComponent parentProductCmpt)
      Creates a new instance of the given ProductComponentGeneration's class. Uses the given ProductComponent as new parent.
      Parameters:
      parentProductCmpt - the new parent component.
      generationTemplate - the generation a new instance is created of
      Returns:
      a new ProductComponentGeneration instance of the same class as this class
    • loadAndVary

      protected void loadAndVary(IXmlPersistenceSupport originalObject, Element variationXML, IClRepositoryObject objectToInitialize)
    • getOriginalProdCmpt

      public ProductComponent getOriginalProdCmpt(IRuntimeRepository runtimeRepository, Element element)
    • isProductVariantXML

      public boolean isProductVariantXML(Element productVariantElement)