示例#1
0
  public void addAttribute(final @Nonnull String attributeCode) throws AttributeNotExists {
    // add attribute feature if it is not added, yet
    addAttributeFeature();

    Attribute attribute = attributeRepository.findByCode(attributeCode);

    if (attribute != null) {
      AttributeFeature attributeFeature = getAttributeFeature();

      if (attributeFeature != null) {
        attributeFeature.addAttribute(attributeCode, attribute.getSettings());
      }
    } else {
      throw new AttributeNotExists(attributeCode);
    }
  }