<p>readEntity.</p>

@param rawType            a {@link java.lang.Class} object.
@param propertiesDelegate a {@link org.glassfish.jersey.internal.PropertiesDelegate} object.
@param <T>                a T object.
@return a T object.
175939
public static <T> T readEntity(Class<T> rawType, PropertiesDelegate propertiesDelegate) {
        return getRequest().readEntity(rawType, propertiesDelegate);
    }
1291718
public static <T> TypeAdapter<T> nullSafeClone(@NonNull final TypeAdapter<T> delegate) {
    return new TypeAdapter<T>() {
      @Nullable @Override public T readFromParcel(@NonNull Parcel source) {
        return readNullable(source, delegate);
      }

      @Override public void writeToParcel(@Nullable T value, @NonNull Parcel dest, int flags) {
        writeNullable(value, dest, flags, delegate);
      }
    };
  }
994336
public static AbstractMessage unserializeFrom( RawDataBuffer rawIn , boolean asInternalCopy )
    {
    	int size = rawIn.readInt();
    	
    	// Extract a sub buffer
    	RawDataBuffer rawMessage = new RawDataBuffer(rawIn.readBytes(size));
        byte type = rawMessage.readByte(); 
        AbstractMessage message = MessageType.createInstance(type);
        message.initializeFromRaw(rawMessage); 
        if (asInternalCopy)
            message.setInternalCopy(true);

        return message;
    }
95233
public PropertyDataReader forProperty(InternalQName name, int type)
   {
      if (nodePropertyReader == null)
      {
         nodePropertyReader = new PropertyDataReader(parent, dataManager);
      }
      return nodePropertyReader.forProperty(name, type);
   }
17837
public static <T> T readEntity(Class<T> rawType, Type type) {
        return getRequest().readEntity(rawType, type);
    }
103411
public static ConstantValuePropertyAccessor fromRawValue(Object rawValue)
    {
        checkNotNull(rawValue);
        return new ConstantValuePropertyAccessor(Optional.of(rawValue.toString()), Optional.of(rawValue));
    }
865438
public org.w3c.dom.Node getMessageBody(Object rawData, boolean bReturnCopy)
    {
        return super.getMessageBody(rawData, bReturnCopy);
    }
1316859
public static ParameterizedTypeName get(Class<?> rawType, Type... typeArguments) {
    return new ParameterizedTypeName(null, ClassName.get(rawType), list(typeArguments));
  }
1044888
private EntityType buildEntityType(SessionFactory sessionFactory, String entityName) {
    EntityType entityType = (EntityType) entityTypes.get(entityName);
    if (null == entityType) {
      ClassMetadata cm = sessionFactory.getClassMetadata(entityName);
      if (null == cm) {
        logger.error("Cannot find ClassMetadata for {}", entityName);
        return null;
      }
      entityType = new EntityType(cm.getEntityName(), cm.getMappedClass(), cm.getIdentifierPropertyName(),
          new IdentifierType(cm.getIdentifierType().getReturnedClass()));
      entityTypes.put(cm.getEntityName(), entityType);

      Map<String, Type> propertyTypes = entityType.getPropertyTypes();
      String[] ps = cm.getPropertyNames();
      for (int i = 0; i < ps.length; i++) {
        org.hibernate.type.Type type = cm.getPropertyType(ps[i]);
        if (type.isEntityType()) {
          propertyTypes.put(ps[i], buildEntityType(sessionFactory, type.getName()));
        } else if (type.isComponentType()) {
          propertyTypes.put(ps[i], buildComponentType(sessionFactory, entityName, ps[i]));
        } else if (type.isCollectionType()) {
          propertyTypes.put(ps[i],
              buildCollectionType(sessionFactory, defaultCollectionClass(type), entityName + "." + ps[i]));
        }
      }
    }
    return entityType;
  }
963633
protected void mergeEntityProperty(EntityPropertyDesc dest, EntityPropertyInfo src) {
    dest.setEntityClassName(src.entityClass.getName());
    dest.setPropertyClassName(src.propertyField.getType().getName());
    Class<?> maybeNumberClass =
        ClassUtil.toBoxedPrimitiveTypeIfPossible(src.propertyField.getType());
    if (Number.class.isAssignableFrom(maybeNumberClass)) {
      dest.setNumber(true);
    }
    if (src.version != null) {
      dest.setVersion(true);
    }
    if (src.id != null) {
      dest.setId(true);
      if (src.generatedValue != null) {
        switch (src.generatedValue.strategy()) {
          case IDENTITY:
            dest.setGenerationType(GenerationType.IDENTITY);
            break;
          case SEQUENCE:
            dest.setGenerationType(GenerationType.SEQUENCE);
            if (src.sequenceGenerator != null) {
              dest.setInitialValue(src.sequenceGenerator.initialValue());
              dest.setAllocationSize(src.sequenceGenerator.allocationSize());
              dest.setAllocationSize(src.sequenceGenerator.allocationSize());
            }
            break;
          case TABLE:
            dest.setGenerationType(GenerationType.TABLE);
            if (src.tableGenerator != null) {
              dest.setInitialValue(src.tableGenerator.initialValue());
              dest.setAllocationSize(src.tableGenerator.allocationSize());
              dest.setAllocationSize(src.tableGenerator.allocationSize());
            }
            break;
          default:
            break;
        }
      }
    }
  }
953664
@SuppressWarnings("unchecked")
    public ModelNode fromEntity(T entity)
    {

        ModelNode operation = new ModelNode();
        List<PropertyBinding> properties = metaData.getBeanMetaData(getType()).getProperties();
        Mutator mutator = metaData.getMutator(getType());

        for(PropertyBinding property : properties)
        {
            String[] splitDetypedName = property.getDetypedName().split("/");

            /**
             * KEYS
             */
            //      if(property.isKey()) continue;

            Object propertyValue = mutator.getValue(entity, property.getJavaName());

            /**
             * EXPRESSIONS
             */
            if(property.doesSupportExpression())
            {
                String exprValue = ExpressionAdapter.getExpressionValue(
                        entity, property.getJavaName()
                );

                if(exprValue!=null)
                {
                    operation.get(splitDetypedName).setExpression(exprValue);
                    continue; // expression have precedence over real values
                }
            }

            /**
             * VALUES
             */
            if(propertyValue!=null)
            {
                try {
                    ModelType modelType = resolveModelType(property.getJavaTypeName());
                    if ((modelType == ModelType.LIST) && (property.getListType() == PropertyBinding.class)) {
                        operation.get(splitDetypedName).set(modelType, property.getEntityAdapterForList().fromEntityPropertyList((List) propertyValue));
                    } else if (modelType == ModelType.LIST) {
                        operation.get(splitDetypedName).set(modelType,
                                property.getEntityAdapterForList().fromEntityList((List) propertyValue));
                    } else if (modelType == ModelType.OBJECT) {
                        // Only Map<String, String> is supported!
                        Map<String, String> map = (Map<String, String>) propertyValue;
                        for (Map.Entry<String, String> entry : map.entrySet()) {
                            operation.get(splitDetypedName).get(entry.getKey()).set(entry.getValue());
                        }
                    } else {
                        operation.get(splitDetypedName).set(modelType, propertyValue);
                    }
                } catch (RuntimeException e) {
                    throw new RuntimeException("Failed to get value "+property.getJavaName(), e);
                }
            }
        }

        return operation;
    }
694327
public RawProperty addExperimentalProperty(String name, ICalDataType dataType, String value) {
		RawProperty raw = new RawProperty(name, dataType, value);
		addProperty(raw);
		return raw;
	}
1008720
public <T> EnhancedAnnotatedType<T> getEnhancedAnnotatedType(Class<T> rawType, String bdaId) {
        return getEnhancedAnnotatedType(getBackedAnnotatedType(rawType, bdaId));
    }
174246
public final int findSerializationType(Class<?> raw)
    {
        if (raw == _prevClass) {
            return _prevType;
        }
        if (raw == String.class) {
            return SER_STRING;
        }
        ClassKey k = (_key == null) ? new ClassKey(raw, _features) : _key.with(raw, _features);
        int type;

        Integer I = _knownSerTypes.get(k);

        if (I == null) {
            type = _findPOJOSerializationType(raw);
            _knownSerTypes.put(new ClassKey(raw, _features), Integer.valueOf(type));
        } else {
            type = I.intValue();
        }
        _prevType = type;
        _prevClass = raw;
        return type;
    }
287443
public <T> T readObject (Input input, Class<T> type) {
		if (input == null) throw new IllegalArgumentException("input cannot be null.");
		if (type == null) throw new IllegalArgumentException("type cannot be null.");
		beginObject();
		try {
			T object;
			if (references) {
				int stackSize = readReferenceOrNull(input, type, false);
				if (stackSize == REF) return (T)readObject;
				object = (T)getRegistration(type).getSerializer().read(this, input, type);
				if (stackSize == readReferenceIds.size) reference(object);
			} else
				object = (T)getRegistration(type).getSerializer().read(this, input, type);
			if (TRACE || (DEBUG && depth == 1)) log("Read", object, input.position());
			return object;
		} finally {
			if (--depth == 0 && autoReset) reset();
		}
	}
339031
public static Class<?> rawClassOf(Type type) {
        if (type instanceof Class<?>) {
            return (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            Type rawType = parameterizedType.getRawType();
            return (Class<?>) rawType;
        } else if (type instanceof GenericArrayType) {
            Type componentType = ((GenericArrayType) type).getGenericComponentType();
            return Array.newInstance(rawClassOf(componentType), 0).getClass();
        } else if (type instanceof TypeVariable) {
            return Object.class;
        } else {
            throw new IllegalArgumentException("Unsupported type " + type.getTypeName());
        }
    }
623372
public static <T> T read(Class<T> clazz, Object id) {
		return execute(new ReadEntityTransaction<T>(clazz, id));
	}