Returns the appropriate Swagger Property instance for a given object class.

@param swagger
@param objectClass
@return a SwaggerProperty instance
11497
protected Property getSwaggerProperty(Swagger swagger, Class<?> objectClass) {
        Property swaggerProperty = null;
        if (byte.class == objectClass || Byte.class == objectClass) {
            // STRING
            swaggerProperty = new StringProperty("byte");
        } else if (char.class == objectClass || Character.class == objectClass) {
            // CHAR is STRING LEN 1
            StringProperty property = new StringProperty();
            property.setMaxLength(1);
            swaggerProperty = property;
        } else if (short.class == objectClass || Short.class == objectClass) {
            // SHORT is INTEGER with 16-bit max & min
            IntegerProperty property = new IntegerProperty();
            property.setMinimum(BigDecimal.valueOf(Short.MIN_VALUE));
            property.setMaximum(BigDecimal.valueOf(Short.MAX_VALUE));
            swaggerProperty = property;
        } else if (int.class == objectClass || Integer.class == objectClass) {
            // INTEGER
            swaggerProperty = new IntegerProperty();
        } else if (long.class == objectClass || Long.class == objectClass) {
            // LONG
            swaggerProperty = new LongProperty();
        } else if (float.class == objectClass || Float.class == objectClass) {
            // FLOAT
            swaggerProperty = new FloatProperty();
        } else if (double.class == objectClass || Double.class == objectClass) {
            // DOUBLE
            swaggerProperty = new DoubleProperty();
        } else if (BigDecimal.class == objectClass) {
            // DECIMAL
            swaggerProperty = new DecimalProperty();
        } else if (boolean.class == objectClass || Boolean.class == objectClass) {
            // BOOLEAN
            swaggerProperty = new BooleanProperty();
        } else if (String.class == objectClass) {
            // STRING
            swaggerProperty = new StringProperty();
        } else if (Date.class == objectClass || Timestamp.class == objectClass) {
            // DATETIME
            swaggerProperty = new DateTimeProperty();
        } else if (java.sql.Date.class == objectClass) {
            // DATE
            swaggerProperty = new DateProperty();
        } else if (java.sql.Time.class == objectClass) {
            // TIME -> STRING
            StringProperty property = new StringProperty();
            property.setPattern("HH:mm:ss");
            swaggerProperty = property;
        } else if (UUID.class == objectClass) {
            // UUID
            swaggerProperty = new UUIDProperty();
        } else if (objectClass.isEnum()) {
            // ENUM
            StringProperty property = new StringProperty();
            List<String> enumValues = new ArrayList<>();
            for (Object enumValue : objectClass.getEnumConstants()) {
                enumValues.add(((Enum) enumValue).name());
            }
            property.setEnum(enumValues);
            swaggerProperty = property;
        } else if (FileItem.class == objectClass) {
            // FILE UPLOAD
            swaggerProperty = new FileProperty();
        } else {
            // Register a Model class
            String modelRef = registerModel(swagger, objectClass);
            swaggerProperty = new RefProperty(modelRef);
        }
        return swaggerProperty;
    }
297561
public <T> T getProperty(final String name, final Class<T> clazz) {
        if (containsProperty(name)) {
            val item = this.properties.get(name);
            if (item == null) {
                return null;
            }
            if (!clazz.isAssignableFrom(item.getClass())) {
                throw new ClassCastException("Object [" + item + " is of type " + item.getClass() + " when we were expecting " + clazz);
            }
            return (T) item;
        }
        return null;
    }
980942
public Object getProperty(Object object, String property) {
        return delegate.getProperty(object, property);
    }
922927
public static Object applyProjection(final Object object, final Class<?> returnClass) {
        Object res = object;
        if (!ODocument.class.isAssignableFrom(returnClass)) {
            ODocument doc = null;
            if (object instanceof ODocument) {
                doc = (ODocument) object;
            }
            if (object instanceof OIdentifiable) {
                // most likely OrientVertex, which is returned under graph connection, even for partial requests
                final Object record = ((OIdentifiable) object).getRecord();
                if (record instanceof ODocument) {
                    doc = (ODocument) record;
                }
            }
            if (doc != null && doc.fieldNames().length == 1) {
                res = doc.fieldValues()[0];
                // if required, perform result correction
                if (res != null && !returnClass.isAssignableFrom(res.getClass())) {
                    res = convertPlainImpl(res, returnClass, true);
                }
            }
        }
        return res;
    }
329810
private ApiKey apiKey() {
        return new ApiKey(swaggerProperties().getAuthorization().getName(),
                swaggerProperties().getAuthorization().getKeyName(),
                ApiKeyVehicle.HEADER.getValue());
    }
1276680
public static Collection<String> getPropertyNames(
                    final Object object
                    )
    {
        if (object == null) {
            throw new IllegalArgumentException( "no object specified" );
        }

        return getPropertyNames( object.getClass() );
    }
914516
public static <T extends PropertyDispatcher> T getInstance(Class<T> cls)
    {
        return getInstance(cls, null);
    }
1059967
public static <T> List<Field> getAnnotatedFields(Object object, Class<? extends Annotation> annotationClass) {
		return getAnnotatedFields(object.getClass(), annotationClass);
	}
96162
public Class getRealClass(Object objectOrProxy)
    {
        IndirectionHandler handler;

        if(isNormalOjbProxy(objectOrProxy))
        {
            String msg;

            try
            {
                handler = getIndirectionHandler(objectOrProxy);
                /*
                 arminw:
                 think we should return the real class
                 */
                // return handler.getIdentity().getObjectsTopLevelClass();
                return handler.getIdentity().getObjectsRealClass();
            }
            catch(ClassCastException e)
            {
                // shouldn't happen but still ...
                msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler.class.getName();
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(IllegalArgumentException e)
            {
                msg = "Could not retrieve real object for given Proxy: " + objectOrProxy;
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
        }
        else if(isVirtualOjbProxy(objectOrProxy))
        {
            handler = VirtualProxy.getIndirectionHandler((VirtualProxy) objectOrProxy);
            /*
             arminw:
             think we should return the real class
             */
            // return handler.getIdentity().getObjectsTopLevelClass();
            return handler.getIdentity().getObjectsRealClass();
        }
        else
        {
            return objectOrProxy.getClass();
        }
    }
1068053
public static <T> T getProperty(Object obj, String propertyName) {
		Method method = getGetterMethod(obj.getClass(), propertyName);
		if (method != null) {
			return invokeMethod(obj, method);
		} else {
			return getFieldValue(obj, propertyName);
		}
	}
396645
public Object getMethodAnalysis(Class<?> analysisClass, MethodDescriptor methodDescriptor) {
        Map<MethodDescriptor, Object> objectMap = getObjectMap(analysisClass);
        return objectMap.get(methodDescriptor);
    }
631120
@Override
    public final Object getProperty(Map context, Object target, Object oname)
            throws OgnlException {
        return super.getProperty(context, target, oname);
    }
945525
public static Object getProperty(final Object object, final String property) {
		Class[] paramTypes = new Class[]{};
		Object[] params = new Object[]{};
		String methodName = "get" + property.substring(0, 1).toUpperCase() + property.substring(1);

		return ReflectionUtil.invokeMethod(object, methodName, params, paramTypes);
	}
1206552
public Set<ApiFlowDoc> getApiFlowDocs(Set<Class<?>> classes, List<ApiMethodDoc> apiMethodDocs) {
		Set<ApiFlowDoc> apiFlowDocs = new TreeSet<ApiFlowDoc>();
		for (Class<?> clazz : classes) {
			log.debug("Getting JSONDoc for class: " + clazz.getName());
			Method[] methods = clazz.getMethods();
			for (Method method : methods) {
				if(method.isAnnotationPresent(ApiFlow.class)) {
					ApiFlowDoc apiFlowDoc = getApiFlowDoc(method, apiMethodDocs);
					apiFlowDocs.add(apiFlowDoc);
				}	
			}
		}
		return apiFlowDocs;
	}
945622
public static Class getPropertyType(Class<?> beanClass, String property){
        Method getter = getGetterMethod(beanClass, property);
        if(getter==null)
            return null;
        else
            return getter.getReturnType();
    }
216733
public List<WarningsGroup> getByProperty(Class<? extends ICalProperty> propertyClass) {
		List<WarningsGroup> warnings = new ArrayList<WarningsGroup>();
		for (WarningsGroup group : this.warnings) {
			ICalProperty property = group.getProperty();
			if (property == null) {
				continue;
			}

			if (propertyClass == property.getClass()) {
				warnings.add(group);
			}
		}
		return warnings;
	}
586728
public Type getType(DocumentResolver definitionDocumentResolver) {
        Type type;
        if (property instanceof RefProperty) {
            RefProperty refProperty = (RefProperty) property;
            if (refProperty.getRefFormat() == RefFormat.RELATIVE)
                type = new ObjectType(refProperty.getTitle(), null); // FIXME : Workaround for https://github.com/swagger-api/swagger-parser/issues/177
            else
                type = new RefType(definitionDocumentResolver.apply(refProperty.getSimpleRef()), new ObjectType(refProperty.getSimpleRef(), null /* FIXME, not used for now */));
        } else if (property instanceof ArrayProperty) {
            ArrayProperty arrayProperty = (ArrayProperty) property;
            Property items = arrayProperty.getItems();
            if (items == null)
                type = new ArrayType(arrayProperty.getTitle(), new ObjectType(null, null)); // FIXME : Workaround for Swagger parser issue with composed models (https://github.com/Swagger2Markup/swagger2markup/issues/150)
            else {
                Type arrayType = new PropertyAdapter(items).getType(definitionDocumentResolver);
                if (arrayType == null)
                    type = new ArrayType(arrayProperty.getTitle(), new ObjectType(null, null)); // FIXME : Workaround for Swagger parser issue with composed models (https://github.com/Swagger2Markup/swagger2markup/issues/150)
                else
                    type = new ArrayType(arrayProperty.getTitle(), new PropertyAdapter(items).getType(definitionDocumentResolver));
            }
        } else if (property instanceof MapProperty) {
            MapProperty mapProperty = (MapProperty) property;
            Property additionalProperties = mapProperty.getAdditionalProperties();
            if (additionalProperties == null)
                type = new MapType(mapProperty.getTitle(), new ObjectType(null, null)); // FIXME : Workaround for Swagger parser issue with composed models (https://github.com/Swagger2Markup/swagger2markup/issues/150)
            else
                type = new MapType(mapProperty.getTitle(), new PropertyAdapter(additionalProperties).getType(definitionDocumentResolver));
        } else if (property instanceof StringProperty) {
            StringProperty stringProperty = (StringProperty) property;
            List<String> enums = stringProperty.getEnum();
            if (CollectionUtils.isNotEmpty(enums)) {
                type = new EnumType(stringProperty.getTitle(), enums);
            } else if (isNotBlank(stringProperty.getFormat())) {
                type = new BasicType(stringProperty.getType(), stringProperty.getTitle(), stringProperty.getFormat());
            } else {
                type = new BasicType(stringProperty.getType(), stringProperty.getTitle());
            }
        } else if (property instanceof ObjectProperty) {
            type = new ObjectType(property.getTitle(), ((ObjectProperty) property).getProperties());
        } else if (property instanceof IntegerProperty) {
            IntegerProperty integerProperty = (IntegerProperty) property;
            List<Integer> enums = integerProperty.getEnum();
            if (CollectionUtils.isNotEmpty(enums)) {
                // first, convert integer enum values to strings
                List<String> enumValuesAsString = enums.stream().map(String::valueOf).collect(Collectors.toList());
                type = new EnumType(integerProperty.getTitle(), enumValuesAsString);
            } else if (isNotBlank(integerProperty.getFormat())) {
                type = new BasicType(integerProperty.getType(), integerProperty.getTitle(), integerProperty.getFormat());
            } else {
                type = new BasicType(property.getType(), property.getTitle());
            }
        } else {
            if (property.getType() == null) {
                return null;
            } else if (isNotBlank(property.getFormat())) {
                type = new BasicType(property.getType(), property.getTitle(), property.getFormat());
            } else {
                type = new BasicType(property.getType(), property.getTitle());
            }
        }
        return type;
    }