/**
  * 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;
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 @Override
 public T get() {
   if (instance != null) {
     return instance;
   }
   try {
     synchronized (injector) {
       final T t;
       if (Name.class.isAssignableFrom(iface)) {
         t = injector.getNamedInstance((Class<Name<T>>) iface);
       } else {
         t = injector.getInstance(iface);
       }
       Aspect a = injector.getAspect();
       if (a != null) {
         a.injectionFutureInstantiated(this, t);
       }
       return t;
     }
   } catch (InjectionException e) {
     throw new RuntimeException(e);
   }
 }
Exemplo n.º 3
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);
  }
Exemplo n.º 4
0
 /** @param aspect The aspect to be a labeller for. */
 public UnitLabeller(Aspect aspect) throws XBRLException {
   super(aspect);
   if (!aspect.getId().equals(UnitAspect.ID))
     throw new XBRLException("This labeller only works for the aspect: " + UnitAspect.ID);
 }