private void setPresentationTemplate(
     Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element presentationTemplateElement = generalElement.element(TAG_PRESENTATION_TEMPLATE);
   if (presentationTemplateElement == null) {
     return;
   }
   PresentationPropertiesParser parser =
       new PresentationPropertiesParser(
           registryCollection.getPresentationTemplateRegistry(),
           registryCollection.getCharmPresentationTemplateRegistry());
   GenericPresentationTemplate template = parser.parseTemplate(presentationTemplateElement);
   characterTemplate.setPresentationTemplate(template);
 }
 private void setTraitCollection(
     Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element traitCollectionElement = generalElement.element(TAG_TRAIT_COLLECTION);
   if (traitCollectionElement == null) {
     return;
   }
   GenericTraitTemplateFactoryParser parser =
       new GenericTraitTemplateFactoryParser(
           registryCollection.getTraitFactoryRegistry(),
           registryCollection.getTraitTemplatePoolRegistry(),
           backgroundRegistry);
   GenericTraitTemplateFactory factory = parser.parseTemplate(traitCollectionElement);
   characterTemplate.setTraitFactory(factory);
 }
 private void setMagicTemplate(Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element magicTemplateElement = generalElement.element(TAG_MAGIC_TEMPLATE);
   if (magicTemplateElement == null) {
     return;
   }
   GenericMagicTemplateParser parser =
       new GenericMagicTemplateParser(
           registryCollection.getMagicTemplateRegistry(), characterTemplate);
   GenericMagicTemplate template = parser.parseTemplate(magicTemplateElement);
   characterTemplate.setMagicTemplate(template);
 }
 private void setToughnessControllingTrait(
     Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element healthElement = generalElement.element(TAG_HEALTH_TEMPLATE);
   if (healthElement == null) {
     return;
   }
   HealthTemplateParser parser =
       new HealthTemplateParser(registryCollection.getHealthTemplateRegistry());
   GenericHealthTemplate template = parser.parseTemplate(healthElement);
   characterTemplate.setHealthTemplate(template);
 }
 private void setEssenceTemplate(
     Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element essenceElement = generalElement.element(TAG_ESSENCE);
   if (essenceElement == null) {
     return;
   }
   EssenceTemplateParser parser =
       new EssenceTemplateParser(registryCollection.getEssenceTemplateRegistry());
   GenericEssenceTemplate essenceTemplate = parser.parseTemplate(essenceElement);
   characterTemplate.setEssenceTemplate(essenceTemplate);
 }
 public CharacterTemplateParser(
     ICharacterTemplateRegistryCollection registryCollection,
     IRegistry<ICharacterType, ICasteCollection> casteCollectionRegistry,
     ICharmProvider provider,
     IIdentificateRegistry<IBackgroundTemplate> backgroundRegistry,
     IRegistry<String, IAdditionalTemplateParser> additionModelTemplateParser) {
   super(registryCollection.getCharacterTemplateRegistry());
   this.registryCollection = registryCollection;
   this.casteCollectionRegistry = casteCollectionRegistry;
   this.provider = provider;
   this.backgroundRegistry = backgroundRegistry;
   this.additionModelTemplateParserRegistry = additionModelTemplateParser;
 }
 private void setAbilityGroups(Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element abilityGroupElement = generalElement.element(TAG_ABILITY_GROUPS);
   if (abilityGroupElement == null) {
     return;
   }
   IXmlTemplateRegistry<GenericGroupedTraitTypeProvider> registry =
       registryCollection.getTraitGroupTemplateRegistry();
   TraitTypeGroupTemplateParser parser =
       new TraitTypeGroupTemplateParser(registry, AllAbilityTraitTypeGroup.getInstance());
   GenericGroupedTraitTypeProvider abilityGroups = parser.parseTemplate(abilityGroupElement);
   characterTemplate.setAbilityGroups(abilityGroups.getTraitTypeGroups());
 }
 private void setAdditionalRules(
     Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element element = generalElement.element(TAG_ADDITIONAL_RULES);
   if (element == null) {
     return;
   }
   AdditionalRulesTemplateParser parser =
       new AdditionalRulesTemplateParser(
           registryCollection.getAdditionalRulesRegistry(),
           provider.getSpecialCharms(
               characterTemplate.getTemplateType().getCharacterType(),
               characterTemplate.getEdition()),
           backgroundRegistry);
   GenericAdditionalRules rules = parser.parseTemplate(element);
   characterTemplate.setAdditionalRules(rules);
 }
 private void setBonusPoints(GenericCharacterTemplate characterTemplate, Element creationElement)
     throws PersistenceException {
   Element bonusPointsElement = creationElement.element("bonusPointCosts"); // $NON-NLS-1$
   if (bonusPointsElement == null) {
     return;
   }
   BonusPointCostTemplateParser parser =
       new BonusPointCostTemplateParser(
           registryCollection.getBonusPointTemplateRegistry(),
           characterTemplate
               .getMagicTemplate()
               .getCharmTemplate()
               .getMartialArtsRules()
               .getStandardLevel());
   GenericBonusPointCosts bonusPoints = parser.parseTemplate(bonusPointsElement);
   characterTemplate.setBonusPointCosts(bonusPoints);
 }
 private void setExperiencePoints(
     GenericCharacterTemplate characterTemplate, Element experienceElement)
     throws PersistenceException {
   Element experiencePointsElement = experienceElement.element(TAG_EXPERIENCE_POINT_COST);
   if (experiencePointsElement == null) {
     return;
   }
   ExperienceTemplateParser parser =
       new ExperienceTemplateParser(
           registryCollection.getExperienceTemplateRegistry(),
           characterTemplate
               .getMagicTemplate()
               .getCharmTemplate()
               .getMartialArtsRules()
               .getStandardLevel());
   GenericExperiencePointCosts experienceTemplate = parser.parseTemplate(experiencePointsElement);
   characterTemplate.setExperiencePointCosts(experienceTemplate);
 }
 private void setYoziGroups(Element generalElement, GenericCharacterTemplate characterTemplate)
     throws PersistenceException {
   Element yoziGroupElement = generalElement.element(TAG_YOZI_GROUPS);
   if (yoziGroupElement == null) {
     GenericGroupedTraitTypeProvider provider =
         new GenericGroupedTraitTypeProvider(AllYoziTraitTypeGroup.getInstance());
     List<String> emptyList = new ArrayList<String>();
     for (YoziType yozi : YoziType.values())
       provider.addGroupedAbilityType(yozi.getId(), yozi.getId(), null, emptyList);
     characterTemplate.setYoziGroups(provider.getTraitTypeGroups());
     return;
   }
   IXmlTemplateRegistry<GenericGroupedTraitTypeProvider> registry =
       registryCollection.getTraitGroupTemplateRegistry();
   TraitTypeGroupTemplateParser parser =
       new TraitTypeGroupTemplateParser(registry, AllYoziTraitTypeGroup.getInstance());
   GenericGroupedTraitTypeProvider yoziGroups = parser.parseTemplate(yoziGroupElement);
   characterTemplate.setYoziGroups(yoziGroups.getTraitTypeGroups());
 }
 private CreationPointTemplateParser createCreationPointTemplateParser() {
   return new CreationPointTemplateParser(registryCollection.getCreationPointTemplateRegistry());
 }