Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.UserFieldMapping


        SpeedoExtension se = sp.getExtensionByKey(SpeedoProperties.FIELD_CONVERTER);
        PType ptype = null;
        String className = null;
        if (se != null) {
            try {
                UserFieldMapping ufm = (UserFieldMapping)
                        java.lang.Class.forName(se.value).newInstance();
                ptype = getPrimitivePType(ufm.getStorageType().getName());
                if (ptype == null) {
                    className = ufm.getStorageType().getName();
                }
            } catch (Exception e) {
                throw new SpeedoException(
                        "Impossible to instanciate the UserFieldMapping class '"
                        + se.value + "' for the field '" + sp.name
View Full Code Here


      sp.getExtensionByKey(SpeedoProperties.FIELD_CONVERTER);
    if (se == null) {
      return;
    }
    f.userFieldMapping = se.value;
    UserFieldMapping ufm = null;
    try {
      ufm = (UserFieldMapping) java.lang.Class.forName(se.value)
        .newInstance();
    } catch (Exception e) {
      throw new SpeedoException(
        "Impossible to instanciate the UserFieldMapping class '"
        + se.value + "' for the field '" + sp.name
        + "' of the class '" + sp.moClass.getFQName() + "':", e);
    }
    if (ufm.getStorageType().isPrimitive()) {
      f.toMemory = "new "
        + getJavaLangType(ufm.getStorageType())
        + "(" + f.toMemory + ")";
    }

    if (ufm.getMemoryType().isPrimitive()) {
      f.toStorage = "new "
        + getJavaLangType(ufm.getMemoryType())
        + "(" + f.toStorage + ")";
    }

    f.toMemory = f.name + "UFM.toMemory(" + f.toMemory + ")";
    f.toStorage = f.name + "UFM.toStorage(" + f.toStorage + ")";

    if (ufm.getStorageType().isPrimitive()) {
      f.toStorage = "(("
        + getJavaLangType(ufm.getStorageType())
        + ") " + f.toStorage + ")."
        + getValueGetter(ufm.getStorageType()) + "()";
    } else {
      f.toStorage = "("
        + ufm.getStorageType().getName()
        + ") " + f.toStorage;
    }

    if (ufm.getMemoryType().isPrimitive()) {
      f.toMemory = "(("
        + getJavaLangType(ufm.getMemoryType())
        + ") " + f.toMemory + ")."
        + getValueGetter(ufm.getMemoryType()) + "()";
    } else {
      f.toMemory = "("
        + ufm.getMemoryType().getName()
        + ") " + f.toMemory;
    }

  }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.api.UserFieldMapping

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.