Package net.sf.joafip.store.entity.classinfo

Examples of net.sf.joafip.store.entity.classinfo.FieldInfo


      throws ConversionException {
    // ASSERTX
    assert fieldValue != null : "field value must be set";
    try {
      // FIXMELUC ______known field
      final FieldInfo fieldInfo = new FieldInfo(declaringClass,
          fieldName, fieldType, Boolean.valueOf(staticField),
          Boolean.valueOf(transientField));
      addNewFieldAndItsValue(fieldIndex, fieldInfo, fieldValue);
    } catch (ClassInfoException exception) {
      throw new ConversionException(exception);
View Full Code Here


      final ClassInfo fieldType, final boolean staticField,
      final boolean transientField, final int index)
      throws ConversionException {
    try {
      // FIXMELUC ______known field
      final FieldInfo fieldInfo = new FieldInfo(declaringClass,
          fieldName, fieldType, Boolean.valueOf(staticField),
          Boolean.valueOf(transientField));
      final Integer previousIndex = fieldValueIndexByFieldInfoMap
          .get(fieldInfo);
      final ObjectAndPersistInfo fieldValue = fieldsValue.get(index);
      if (previousIndex == null) {
        fieldValueIndexByFieldInfoMap.put(fieldInfo, index);
        fieldInfoByIndex.put(index, fieldInfo);
        // if (fieldValue != null) {
        // FIXMELUC x explain case not assignable accepted
        // assertFieldAssignable(fieldInfo, fieldValue);
        // }
      } else {
        final int iPreviousIndex = previousIndex.intValue();
        if (iPreviousIndex != index) {
          throw new ConversionException("field \"" + fieldInfo
              + "\" have index " + iPreviousIndex
              + ", can not be set to index " + index);
        }
        final FieldInfo previousFieldInfo = fieldInfoByIndex
            .get(iPreviousIndex);
        if (!previousFieldInfo.equals(fieldInfo)) {
          throw new ConversionException("try to set field #" + index
              + " to \"" + fieldInfo + "\" and already set to \""
              + previousFieldInfo + "\"");
        }
      }
View Full Code Here

      final ClassInfo declaringClass, final String fieldName,
      final ClassInfo fieldType, final boolean staticField,
      final boolean transientField) throws ConversionException {
    try {
      // FIXMELUC ______known field
      final FieldInfo originalFieldInfo = new FieldInfo(
          originalDeclaringClass, originalFieldName,
          originalFieldType, null, null);
      final Integer index = fieldValueIndexByFieldInfoMap
          .remove(originalFieldInfo);
      if (index == null) {
        throw new ConversionException("previous field "
            + originalFieldInfo + "\n does not exist");
      }
      final FieldInfo fieldInfo = new FieldInfo(declaringClass,
          fieldName, fieldType, Boolean.valueOf(staticField),
          Boolean.valueOf(transientField));
      fieldValueIndexByFieldInfoMap.put(fieldInfo, index);
      fieldInfoByIndex.put(index, fieldInfo);
      fieldValueIndexByFieldNameMap.put(fieldName, index);
View Full Code Here

    for (int index = 0; index < size; index++) {
      final int newIndex = newIndexList[index];
      final ObjectAndPersistInfo fieldValue = elementData[index];
      fieldsValue.set(newIndex, fieldValue);
      final FieldInfo fieldInfo = fieldInfos[index];
      if (fieldInfo != null) {
        fieldInfoByIndex.put(newIndex, fieldInfo);
        fieldValueIndexByFieldInfoMap.put(fieldInfo, newIndex);
        fieldValueIndexByFieldNameMap.put(fieldInfo.getFieldName(),
            newIndex);
        // FIXMELUC x explain case not assignable accepted
        // assertFieldAssignable(fieldInfo, fieldValue);
      }
    }
View Full Code Here

        stringBuilder.append("null");
      } else {
        stringBuilder.append(fieldValue.toString());
      }
      stringBuilder.append("\n  field info: ");
      final FieldInfo fieldInfo = fieldInfoByIndex.get(index);
      if (fieldInfo == null) {
        stringBuilder.append("none");
      } else {
        stringBuilder.append(fieldInfo);
        stringBuilder.append("\nindex by field name=");
        final String fieldName = fieldInfo.getFieldName();
        Integer indexByName = fieldValueIndexByFieldNameMap
            .get(fieldName);
        stringBuilder.append(indexByName);

        stringBuilder.append("\nindex by field info=");
View Full Code Here

    // ASSERTX
    assert fieldList != null : "field list can not be null";
    converterClass = conversionDefEntry.getConverterClass();
    staticConverterClass = conversionDefEntry.getStaticConverterClass();
    if (conversionDefEntry.isFieldReplacementDef()) {
      final FieldInfo originalFieldInfo = conversionDefEntry
          .getOriginalFieldInfo();
      final FieldInfo replacementFieldInfo = conversionDefEntry
          .getReplacementFieldInfo();
      try {
        // ASSERTX
        assert assertPerisstenceType(originalFieldInfo,
            replacementFieldInfo);
View Full Code Here

      throw new ConversionException("replacement class missmatch was "
          + replacementClass + " and update with "
          + newReplacementClass + FOR + conversionDefEntry);
    }
    if (conversionDefEntry.isFieldReplacementDef()) {
      final FieldInfo originalFieldInfo = conversionDefEntry
          .getOriginalFieldInfo();
      final FieldInfo replacementFieldInfo = conversionDefEntry
          .getReplacementFieldInfo();
      try {
        // ASSERTX
        assert assertPerisstenceType(originalFieldInfo,
            replacementFieldInfo);
View Full Code Here

   */
  public void test3() throws StoreException, FilePersistenceException,
      ConversionException, ClassInfoException, ClassNotFoundException {

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final FieldInfo fieldInfo = new FieldInfo(
    /**/classInfoForA/* declaringClass */,
    /**/VALUE,
    /**/fieldType,
    /**/false, false);

View Full Code Here

        ClassInfo.NULL, ClassInfo.NULL);

    replacementDefMap.add(conversionDefEntry);

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final FieldInfo fieldInfo = new FieldInfo(classInfoForA, VALUE,
        fieldType, false, false);

    conversionDefEntry = new ConversionDefEntry(classInfoForA, version0,
        version1);
    conversionDefEntry.addToFieldList(fieldInfo);
View Full Code Here

    final ReplacementDefMap replacementDefMap =
    /**/new ReplacementDefMap();

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final FieldInfo fieldInfo = new FieldInfo(
    /**/classInfoForA/* declaring class */,
    /**/VALUE,
    /**/fieldType,
    /**/false, false);
    ConversionDefEntry conversionDefEntry = new ConversionDefEntry(
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.classinfo.FieldInfo

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.