Examples of JavaType


Examples of org.apache.jdo.model.java.JavaType

     * <code>null</code> if not present in this model instance.
     */
    public JavaType getJavaType(String name)
    {
        synchronized (types) {
            JavaType javaType = (JavaType)types.get(name);
            if (javaType == null) {
                try {
                    final boolean initialize = false;
                    Class clazz = ReflectionJavaModelFactory.forNamePrivileged(
                        name, initialize, classLoader);
View Full Code Here

Examples of org.apache.jdo.model.java.JavaType

     */
    public JavaType getJavaTypeInternal(Class clazz)
    {
        String name = clazz.getName();
        synchronized (types) {
            JavaType javaType = (JavaType)types.get(name);
            if (javaType == null) {
                javaType = newJavaTypeInstance(clazz);
                types.put(name, javaType);
            }
            return javaType;
View Full Code Here

Examples of org.apache.jdo.model.java.JavaType

    {
        affirm(classPath);
        affirm(fieldName);
        final String className = classPath.replace('/', '.');
        try {
            final JavaType javaType = javaModel.getJavaType(className);
            final JavaField javaField = javaType.getJavaField(fieldName);
            final JavaType declaringClass = javaField.getDeclaringClass();
            return declaringClass.getName().replace('.', '/');
        } catch (ModelFatalException ex) {
            throw new EnhancerMetaDataUserException(ex);
        }
    }
View Full Code Here

Examples of org.apache.jdo.model.java.JavaType

    {       
        affirm(classPath);
        affirm(fieldName);
        try {
            final JDOClass clazz = getJDOClass(classPath);
            JavaType javaClass = clazz.getJavaType();
            affirm(javaClass != null,
                   "cannot find class file for class: " + classPath);
            JavaField javaField = javaClass.getJavaField(fieldName);
            affirm(javaField != null,
                   "cannot find java field " + classPath + "." + fieldName);
            JavaType fieldType = javaField.getType();
            JDOField field = clazz.getField(fieldName);
            // if field not known by JDOClass (not specified in JDO XML),
            // create the field only if the model's method of default
            // calculation would yield a persistent field.  We must not
            // change the models state by newly created fields with
View Full Code Here

Examples of org.apache.jdo.model.java.JavaType

     */
    public boolean isSerializableClass(String classPath)
        throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError
    {
        final String className = classPath.replace('/', '.');
        final JavaType javaType = javaModel.getJavaType(className);
        return javaType.isCompatibleWith(serializableJavaType);
    }
View Full Code Here

Examples of org.apache.jdo.model.java.JavaType

            }

            // field not known by JDOClass (not specified in JDO XML)
            // apply model's method of default calculation without
            // changing the model's state
            JavaType fieldType = javaModel.getJavaType(javaModel.getTypeName(fieldSig));
            affirm(fieldType != null,
                   "cannot get java type for: " + fieldSig);
            return !TypeSupport.isPersistenceFieldType(fieldType);
        } catch (ModelFatalException ex) {
            throw new EnhancerMetaDataUserException(ex);
View Full Code Here

Examples of org.apache.torque.templates.typemapping.JavaType

                columnElement,
                controllerState);
        columnElement.setAttribute("schemaType", schemaType);
        setDomainAttributes(columnElement, controllerState);

        JavaType fieldJavaType = getFieldJavaType(columnElement, schemaType);
        columnElement.setAttribute(
                JavaFieldAttributeName.FIELD_TYPE,
                fieldJavaType.getFullClassName());
        JavaType fieldJavaObjectType = TypeMap.getJavaObjectType(schemaType);
        columnElement.setAttribute(
                ColumnAttributeName.FIELD_OBJECT_TYPE,
                fieldJavaObjectType.getFullClassName());


        setPrimitiveTypeAttribute(columnElement, fieldJavaType);
        setNumberTypeAttribute(columnElement, fieldJavaType);
        setJavaNameAttribute(columnElement);
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType

            throw new IllegalArgumentException("Invalid sub type: "+aClass+", of base type: "+baseType.getRawClass());
        return rc;
    }

    public JavaType typeFromId(String id) {
        JavaType rc = idToType.get(id);
        if(rc==null)
            throw new IllegalArgumentException("Invalid type id '"+id);
        return rc;
    }
View Full Code Here

Examples of org.codehaus.jackson.type.JavaType

        }

        try {
            Class<?> cls = context.getTargetDataType().getPhysical();
            ObjectMapper mapper = JacksonHelper.createObjectMapper(cls);
            JavaType javaType = TypeFactory.type(context.getTargetDataType().getGenericType());
            if (source instanceof String) {
              String sourceString = (String) source;
              if(sourceString.isEmpty()) {
                return sourceString;
              } else {
View Full Code Here

Examples of org.data2semantics.platform.core.data.JavaType

      Class<?> paramClazz = inputNameToParamType.get(ii.name());
     
      if(!(ii.dataType() instanceof JavaType))
        return false;
     
      JavaType jType = (JavaType)ii.dataType();
   
      if(!PlatformUtil.isAssignableFrom(paramClazz, jType.clazz()))
        return false;
    }
   
    return true;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.