Package net.sf.joafip.store.entity.export_import.in

Examples of net.sf.joafip.store.entity.export_import.in.ClassDef


  public ObjectModelForImport createRootObject() throws ImportException {
    final StoreRoot4 storeRoot = new StoreRoot4();
    storeRoot.setDataModelIdentifier(currentDataModelIdentifier);
    setDataRecordIdentifierAssociatedToObject(storeRoot,
        Store.IDENTIFIER_FOR_ROOT);
    final ClassDef classDef = getClassReplacementDef(storeRoot.getClass());
    return new ObjectModelForImport(Store.IDENTIFIER_FOR_ROOT,
        classDef.getReplacementDef(), storeRoot,
        classDef.getReplacementClass(), false);
  }
View Full Code Here


    } catch (final NegativeArraySizeException exception) {
      throw new ImportException(exception);
    }
    setDataRecordIdentifierAssociatedToObject(newInstance,
        dataRecordIdentifier);
    final ClassDef arrayClassDef = classDefForClass(newInstance.getClass());
    return new ObjectModelForImport(dataRecordIdentifier,
        arrayClassDef.getReplacementDef(), newInstance,
        arrayClassDef.getReplacementClass(), arraySize);
  }
View Full Code Here

      replacementDef = EMPTY_LINKED_LIST;
    } else {
      replacementDef = classInfo.getReplacementDef(previousRelesase,
          previousDataModelIdentifier);
    }
    return new ClassDef(classInfo, replacementDef);
  }
View Full Code Here

  private void startObjectElement(final Attributes atts) throws SAXException {
    assertNumberOfAttribute(atts.getLength(), 2);
    final Map<String, String> attsMap = attributeMap(atts);
    final DataRecordIdentifier dataRecordIdentifier =
    /**/dataRecordIdentifierAttribute(attsMap, "id");
    final ClassDef classDef = classAttribute(attsMap, "class");
    try {
      currentObject = xmlImporter.createObject(dataRecordIdentifier,
          classDef);
    } catch (final ImportException exception) {
      logger.error(START_ELEMENT_ERROR + location(), exception);
View Full Code Here

  private void startStaticElement(final Attributes atts) throws SAXException {
    assertNumberOfAttribute(atts.getLength(), 2);
    final Map<String, String> attsMap = attributeMap(atts);
    final DataRecordIdentifier dataRecordIdentifier = /**/dataRecordIdentifierAttribute(
        attsMap, "id");
    final ClassDef classDef = classAttribute(attsMap, "class");
    currentObject = new ObjectModelForImport(dataRecordIdentifier,
        classDef.getReplacementDef(), classDef.getReplacementClass());
  }
View Full Code Here

    assertNumberOfAttribute(atts.getLength(), 3);
    final Map<String, String> attsMap = attributeMap(atts);
    /* "id","class","constantName" */
    final DataRecordIdentifier dataRecordIdentifier =
    /**/dataRecordIdentifierAttribute(attsMap, "id");
    final ClassDef classDef = classAttribute(attsMap, "class");
    final String constantName = attribute(attsMap, "constantName");
    try {
      currentObject = xmlImporter.createEnum(dataRecordIdentifier,
          classDef, constantName);
    } catch (final ImportException exception) {
View Full Code Here

   *
   * @throws SAXException
   */
  private void endObjectElement() throws SAXException {
    try {
      final ClassDef classDef = currentObject.getClassDef();
      final ValuedFieldList valuedFieldList = xmlImporter
          .convert(currentObject.getValuedFieldList(),
              classDef.getReplacementDef(),
              currentObject.getFieldsInfo());
      final Object object = currentObject.getObject();
      final ClassInfo classInfo = currentObject.getClassInfo();

      xmlImporter.recordObject(object, currentObject.isStateSet(),
View Full Code Here

  private void startObjectElement(final Attributes atts) throws SAXException {
    try {
      final Map<String, String> attsMap = attributeMap(atts);
      /* "id", "class" */
      final ClassDef objectClassDef;
      final Object object;
      final boolean stateSet;
      if (attsMap.containsKey("id")) {
        // <object id="xxx" class="xxx"
        objectClassDef = classAttribute(attsMap, "class");
        final int objectIdentifier = intAttribute(attsMap, "id");
        object = xmlImporter.createObject(objectClassDef,
            objectIdentifier);
        stateSet = false;
      } else if (attsMap.containsKey("ref")) {
        // <object ref="xxx"
        final int objectIdentifier = intAttribute(attsMap, "ref");
        object = xmlImporter.getObject(objectIdentifier);
        objectClassDef = xmlImporter.classForName(object.getClass()
            .getName());
        stateSet = true;
      } else {
        final String message = "expected attribute \"id\" or \"ref\""
            + location();
        logger.error(message);
        throw new SAXException(message);
      }
      currentObjectModel = new ObjectModelForImport(
          objectClassDef.getReplacementDef(), object,
          objectClassDef.getReplacementClass(), stateSet);
      objectCreated(currentObjectModel);
    } catch (ImportException exception) {
      logger.error(START_ELEMENT_ERROR, exception);
      throw new SAXException(exception);
    } catch (ImportClassNotFoundException exception) {
View Full Code Here

      throws SAXException {
    try {
      final Map<String, String> attsMap = attributeMap(atts);
      /* "id","class","constantName" */
      final int objectIdentifier = intAttribute(attsMap, "id");
      final ClassDef objectClassDef = classAttribute(attsMap, "class");
      final Object object;
      final String constantName = attribute(attsMap, "constantName");
      object = xmlImporter.createEnum(objectClassDef, objectIdentifier,
          constantName);
      final ObjectModelForImport objectModelForImport = new ObjectModelForImport(
          objectClassDef.getReplacementDef(), object,
          objectClassDef.getReplacementClass(), constantName);
      objectCreated(objectModelForImport);
      return objectModelForImport;
    } catch (ImportException exception) {
      logger.error(START_ELEMENT_ERROR, exception);
      throw new SAXException(exception);
View Full Code Here

  }

  protected ClassDef classAttribute(final Map<String, String> attsMap,
      final String attributeName) throws SAXException {
    final String className = attribute(attsMap, attributeName);
    final ClassDef classDef;
    // try {
    try {
      classDef = xmlImporter.classForName(className);
    } catch (ImportException exception) {
      final String message = "failed obtain class " + location() + "\n"
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.export_import.in.ClassDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.