Пример #1
0
  private Attribute buildAttribute(NidStringMember attributeAnnotation)
      throws IOException, ContradictionException {
    String name = attributeAnnotation.getString1();

    // Type.
    int typeNid = attributeAnnotation.getNid1();
    Type type = getTypeForNid(typeNid);

    Attribute a = new Attribute(name, type);
    LOG.debug("Attribute: " + a.getName());

    // Get all annotations on the attribute annotation.
    Collection<? extends RefexChronicleBI<?>> attributeAnnotations = null;
    // TODO -BACgetLatestAnnotations(attributeAnnotation);

    // DefaultValue.
    String defaultValue = getDefaultValue(attributeAnnotations);
    if (defaultValue != null) {
      LOG.debug("    defaultValue: " + defaultValue);
      a.setDefaultValue(defaultValue);
    }

    // Multiplicity
    Multiplicity multiplicity = buildMultiplicity(attributeAnnotations);
    if (multiplicity != null) {
      LOG.debug("    multiplicity: " + multiplicity);
      a.setMultiplicity(multiplicity);
    }

    // Visibility
    VisibilityKind visibility = getVisibility(attributeAnnotations);
    if (visibility != null) {
      LOG.debug("    visibility: " + visibility);
      a.setVisibility(visibility);
    }

    // Keep track for later.
    nidAttributeMap.put(attributeAnnotation.getNid(), a);

    return a;
  }