Class ProductVariantRuntimeHelper
- java.lang.Object
-
- org.faktorips.runtime.internal.productvariant.ProductVariantRuntimeHelper
-
public class ProductVariantRuntimeHelper extends java.lang.ObjectHelper class for loading product variants or varied product components respectively.- Author:
- Stefan Widmaier, FaktorZehn AG
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringATTRIBUTE_NAME_RUNTIME_IDprotected static java.lang.StringATTRIBUTE_NAME_VARIED_PRODUCT_CMPT
-
Constructor Summary
Constructors Constructor Description ProductVariantRuntimeHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProductComponentGenerationcreateNewInstance(ProductComponentGeneration generationTemplate, ProductComponent parentProductCmpt)Creates a new instance of the givenProductComponentGeneration's class.ProductComponentgetOriginalProdCmpt(IRuntimeRepository runtimeRepository, org.w3c.dom.Element element)IProductComponentGenerationinitProductComponentGenerationVariation(IRuntimeRepository runtimeRepository, GenerationTocEntry tocEntry, org.w3c.dom.Element genElement)The given generation is initialized with the data of the original product component generation and the variations defined by the variant.voidinitProductComponentVariation(ProductComponent originalProductComponent, ProductComponent productComponentToBeInitialized, org.w3c.dom.Element prodCmptElement)The given product component is initialized with the data of the original product component and the variations defined by the variant.booleanisProductVariantXML(org.w3c.dom.Element productVariantElement)protected voidloadAndVary(IXmlPersistenceSupport originalObject, org.w3c.dom.Element variationXML, IClRepositoryObject objectToInitialize)
-
-
-
Field Detail
-
ATTRIBUTE_NAME_VARIED_PRODUCT_CMPT
protected static final java.lang.String ATTRIBUTE_NAME_VARIED_PRODUCT_CMPT
- See Also:
- Constant Field Values
-
ATTRIBUTE_NAME_RUNTIME_ID
protected static final java.lang.String ATTRIBUTE_NAME_RUNTIME_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
initProductComponentVariation
public void initProductComponentVariation(ProductComponent originalProductComponent, ProductComponent productComponentToBeInitialized, org.w3c.dom.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 valuesproductComponentToBeInitialized- the yet un-initialized product component.prodCmptElement- the XML element containing product component's variation data.
-
initProductComponentGenerationVariation
public IProductComponentGeneration initProductComponentGenerationVariation(IRuntimeRepository runtimeRepository, GenerationTocEntry tocEntry, org.w3c.dom.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- theGenerationTocEntryfor the requestedProductComponentGenerationgenElement- 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 givenProductComponentGeneration's class. Uses the givenProductComponentas new parent.- Parameters:
parentProductCmpt- the new parent component.generationTemplate- the generation a new instance is created of- Returns:
- a new
ProductComponentGenerationinstance of the same class as this class
-
loadAndVary
protected void loadAndVary(IXmlPersistenceSupport originalObject, org.w3c.dom.Element variationXML, IClRepositoryObject objectToInitialize)
-
getOriginalProdCmpt
public ProductComponent getOriginalProdCmpt(IRuntimeRepository runtimeRepository, org.w3c.dom.Element element)
-
isProductVariantXML
public boolean isProductVariantXML(org.w3c.dom.Element productVariantElement)
-
-