/**
  * Liest alle Konfigurationsdaten dieses Objekts
  *
  * @return Konfigurationsdaten
  * @throws MissingObjectException Falls ein Objekt fehlt (entweder das Systemobjekt, oder die
  *     Attributgruppe oder der Aspekt)
  */
 public Map<PidAttributeGroupUsage, KExDaVAttributeGroupData> getAllConfigurationData()
     throws MissingObjectException {
   final SystemObject wrappedObject = getWrappedObjectOrThrowException();
   final Map<PidAttributeGroupUsage, KExDaVAttributeGroupData> result =
       new HashMap<PidAttributeGroupUsage, KExDaVAttributeGroupData>();
   final List<AttributeGroup> attributeGroups = wrappedObject.getType().getAttributeGroups();
   for (final AttributeGroup attributeGroup : attributeGroups) {
     final Collection<Aspect> aspects = attributeGroup.getAspects();
     for (final Aspect aspect : aspects) {
       final Data data = wrappedObject.getConfigurationData(attributeGroup, aspect);
       if (data != null) {
         result.put(
             new PidAttributeGroupUsage(attributeGroup.getPid(), aspect.getPid()),
             new KExDaVAttributeGroupData(data, _manager));
       }
     }
   }
   return result;
 }
Esempio n. 2
0
  /**
   * Defines a new aspect of the entity. It's protected - aspects can only be defined in the
   * entity's implementation as a part of its state definition.
   *
   * @param newAspect
   */
  protected final void defineAspect(Aspect newAspect) {
    // check if we're not overriding an existing aspect - we can't do that, we can replace
    // an existing one though
    int count = m_aspects.size();
    for (int i = 0; i < count; ++i) {
      Aspect aspect = m_aspects.get(i);
      if (newAspect.getClass().isInstance(aspect)) {
        m_aspects.set(i, newAspect);
        return;
      }
    }

    // this is a brand new aspect
    m_aspects.add(newAspect);
  }