@Override
  protected void link(JAXBContextImpl grammar) {
    if (uriProperties != null) return; // avoid linking twice

    super.link(grammar);

    if (superClazz != null) superClazz.link(grammar);

    getLoader(grammar, true); // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if (superClazz != null) {
      if (idProperty == null) idProperty = superClazz.idProperty;

      if (!superClazz.hasElementOnlyContentModel()) hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
      for (int i = 0; i < bi.properties.length; i++) {
        Property p = bi.properties[i];
        if (p instanceof AttributeProperty) attProps.add((AttributeProperty) p);
        if (p.hasSerializeURIAction()) uriProps.add(p);
      }
    }
    if (grammar.c14nSupport) Collections.sort(attProps);

    if (attProps.isEmpty()) attributeProperties = EMPTY_PROPERTIES;
    else attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if (uriProps.isEmpty()) uriProperties = EMPTY_PROPERTIES;
    else uriProperties = uriProps.toArray(new Property[uriProps.size()]);
  }
 @Override
 public void wrapUp() {
   for (Property p : properties) p.wrapUp();
   ci = null;
   super.wrapUp();
 }