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

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


    ConversionDefEntry conversionDefEntry = new ConversionDefEntry(
        classInfoForA, version0, classInfoForB, version1,
        ClassInfo.NULL, ClassInfo.NULL);
    replacementDefMap.add(conversionDefEntry);

    final FieldInfo fieldInfo = new FieldInfo(classInfoForA, VALUE,
        fieldType, false, false);
    conversionDefEntry = new ConversionDefEntry(classInfoForA, version0,
        version1);
    conversionDefEntry.addToFieldList(fieldInfo);
    replacementDefMap.add(conversionDefEntry);
View Full Code Here


    final ClassInfo originalClass = classInfoFactory
        .getClassInfo(originalClassName);
    // original field, optional
    final ClassInfo fieldType = classInfoFactory
        .getNoProxyClassInfo(Object.class);
    final FieldInfo originalField;
    if (strings[2].length() == 0) {
      originalField = null;
    } else {
      final String fieldName = strings[2];
      originalField = new FieldInfo(originalClass, fieldName, fieldType,
          Boolean.FALSE, Boolean.TRUE);
    }
    // new identifier
    final String newIdentifierName = strings[3];
    final int newIdentifier = Version.releaseId(newIdentifierName);
    // replacement class name
    final String replacementClassName = strings[4];
    final ClassInfo replacementClass = classInfoFactory
        .getClassInfo(replacementClassName);
    // replacement field name, optional
    final FieldInfo replacementField;
    if (strings.length < 6 || strings[5].length() == 0) {
      replacementField = null;
    } else {
      replacementField = new FieldInfo(replacementClass,
          strings[5]/* fieldName */, fieldType, Boolean.FALSE,
          Boolean.FALSE);
    }
    // converter class name, optional
    final ClassInfo converterClass;
View Full Code Here

      if (originalFieldName != null) {
        assertNotNull(
            "expected result must define a replacement field name",
            replacementFieldName);

        final FieldInfo originalFieldInfo =
        /**/new FieldInfo(originalClass, originalFieldName, fieldType,// NOPMD
            null/* staticField */, null/* transientField */);

        FieldInfo replacementFieldInfo = originalFieldInfo;
        for (ClassReplacementDef classReplacementDef : replacementDef) {
          if (replacementFieldInfo != null) {
            final FieldReplacementDef replacementFieldInfox = classReplacementDef
                .getReplacementFieldInfo(replacementFieldInfo);
            if (replacementFieldInfox == null) {
              replacementFieldInfo = null;// NOPMD
            } else {
              replacementFieldInfo = replacementFieldInfox
                  .getFieldInfo();
            }
          }
        }
        final FieldInfo exectedReplacementFieldInfo =
        /**/new FieldInfo(replacementClass, replacementFieldName,// NOPMD
            replacementClass, null/* staticField */, null/* transientField */);
        assertEquals("bad field replacement",
            exectedReplacementFieldInfo, replacementFieldInfo);
      }
      resultIndex++;
View Full Code Here

    assertEquals("bad replacement class", replacementClass,
        classReplacementDef.getReplacementClass());

    final ClassInfo fieldType = classInfoFactory
        .getClassInfo("net.sf.joafip.java.util.IPNavigableTreeSet");
    final FieldInfo originalFieldInfo = new FieldInfo(classInfo,
        "pTreeSet", fieldType/* fieldType */, null/* staticField */, null/* transientField */);
    final FieldReplacementDef replacementFieldinfo = classReplacementDef
        .getReplacementFieldInfo(originalFieldInfo);
    assertFalse("must not be a deleted field",
        replacementFieldinfo.isDeletedField());
    final FieldInfo newFieldInfo = replacementFieldinfo.getFieldInfo();
    final FieldInfo expected = new FieldInfo(classInfo, "treeSet",
        fieldType/* fieldType */, null/* staticField */, null/* transientField */);
    assertEquals("bad replacement", expected, newFieldInfo);
  }
View Full Code Here

          .getSonObjectNodeList();
      final List<Object> sonObjectList = objectNode.getSonObjectList();
      final Iterator<FieldInfo> iterator = objectNode
          .getSonFieldInfoList().iterator();
      for (Object sonObject : sonObjectList) {
        final FieldInfo sonFieldInfo = iterator.next();

        final ObjectNode sonObjectNode = new ObjectNode(identifier,// NOPMD
            sonObject, classInfoFactory);
        final ObjectNode sonToVisit = toVisitSet.get(sonObjectNode);
        if (sonToVisit == null) {
View Full Code Here

      stringBuilder.append(current.toString());
      stringBuilder.append(" parent ");
      if (parent != null) {
        stringBuilder.append(parent.toString());
        stringBuilder.append('#');
        final FieldInfo fieldInfo = current.fieldInfo(parent);
        if (fieldInfo != null) {
          stringBuilder.append(fieldInfo.getFieldName());
        }
      }
      stringBuilder.append('\n');
      parent = current;
    }
View Full Code Here

  public List<ObjectNode> getSonObjectNodeList() {
    return sonObjectNodeList;
  }

  public FieldInfo fieldInfo(final ObjectNode parent) {
    final FieldInfo fieldInfo;
    if (parent == null) {
      fieldInfo = null;
    } else {
      fieldInfo = parentSet.get(parent);
    }
View Full Code Here

    while (currentClass != null && !Object.class.equals(currentClass)
        && !Enum.class.equals(currentClass)) {
      declaredFields = currentClass.getDeclaredFields();
      for (Field field : declaredFields) {
        final int modifiers = field.getModifiers();
        final FieldInfo fieldInfo = createFieldInfo(classInfoFactory,
            field);
        if (Modifier.isStatic(modifiers)) {
          /*
           * static fields
           */
 
View Full Code Here

    try {
      final ClassInfo declaringClass = classInfoFactory
          .getNoProxyClassInfo(field.getDeclaringClass());
      final ClassInfo fieldType = classInfoFactory
          .getNoProxyClassInfo(field.getType());
      final FieldInfo fieldInfo = new FieldInfo(field, declaringClass,
          fieldType);
      return fieldInfo;
    } catch (ClassInfoException exception) {
      throw new ReflectException(exception);
    }
View Full Code Here

      int originalFieldIndex = 0;
      for (FieldInfo originalFieldInfo : originalFieldList) {
        final FieldReplacementDef fieldReplacementDef = classReplacementDef
            .getReplacementFieldInfo(originalFieldInfo);
        if (fieldReplacementDef == null) {
          final FieldInfo newFieldInfo = replacementFieldInfo(
              intermediateConversionDef.getIdentifier(),
              originalFieldInfo);
          classReplacementDef.addFieldConversion(originalFieldInfo,
              originalFieldIndex, newFieldInfo,
              // replacement field index is unknown
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.