Package com.cedarsoftware.io
Class MetaUtils
java.lang.Object
com.cedarsoftware.io.MetaUtils
This utility class has the methods mostly related to reflection related code.
- Author:
- John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
License
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
findClosest
(Class<?> clazz, Map<Class<?>, T> workerClasses, T defaultClass) Deprecated.This method is deprecated and will be removed in a future version.static Class<?>
getClassIfEnum
(Class<?> c) Deprecated.This method is deprecated and will be removed in a future version.static String
getLogMessage
(String methodName, Object[] args) Format a nice looking method signature for logging outputstatic String
getLogMessage
(String methodName, Object[] args, int argCharLen) static <K,
V> V getValueWithDefaultForMissing
(Map map, K key, V defaultValue) static <K,
V> V getValueWithDefaultForNull
(Map map, K key, V defaultValue) static boolean
isLogicalPrimitive
(Class<?> c) Deprecated.static boolean
isPrimitive
(Class<?> c) Deprecated.This method is deprecated and will be removed in a future version.static int
Deprecated.This method is deprecated and will be removed in a future version.loadMapDefinition
(String resName) Load in a Map-style properties file.static byte[]
loadResourceAsBytes
(String resourceName) Deprecated.This method is deprecated and will be removed in a future version.static String
loadResourceAsString
(String resourceName) Deprecated.This method is deprecated and will be removed in a future version.loadSetDefinition
(String resName) Load in a Set-style simple file of values.static Object
newInstance
(com.cedarsoftware.util.convert.Converter converter, Class<?> c, Collection<?> argumentValues) Deprecated.This method is deprecated and will be removed in a future version.static String
Deprecated.This method is deprecated and will be removed in a future version.static void
safelyIgnoreException
(Runnable runnable) Deprecated.This method is deprecated and will be removed in a future version.static <T> T
safelyIgnoreException
(Callable<T> callable, T defaultValue) Deprecated.This method is deprecated and will be removed in a future version.static void
setFieldValue
(Field field, Object instance, Object value) Deprecated.static void
setUseUnsafe
(boolean state) Deprecated.This method is deprecated and will be removed in a future version.static int
trimLength
(String s) Deprecated.This method is deprecated and will be removed in a future version.static void
trySetAccessible
(AccessibleObject object) Deprecated.This method is deprecated and will be removed in a future version.
-
Method Details
-
getLogMessage
Format a nice looking method signature for logging output -
getLogMessage
-
getValueWithDefaultForNull
-
getValueWithDefaultForMissing
-
setFieldValue
Deprecated. -
isLogicalPrimitive
Deprecated.Legacy API that many applications consumed. -
loadMapDefinition
Load in a Map-style properties file. Expects key and value to be separated by a = (whitespace ignored). Ignores lines beginning with a # and it also ignores blank lines.- Parameters:
resName
- String name of the resource file.
-
loadSetDefinition
Load in a Set-style simple file of values. Expects values to be one per line. Ignores lines beginning with a # and it also ignores blank lines.- Parameters:
resName
- String name of the resource file.- Returns:
- the set of strings
-
loadResourceAsString
Deprecated.This method is deprecated and will be removed in a future version. UseClassUtilities.loadResourceAsString(String)
directly instead. -
loadResourceAsBytes
Deprecated.This method is deprecated and will be removed in a future version. UseClassUtilities.loadResourceAsBytes(String)
directly instead. -
removeLeadingAndTrailingQuotes
Deprecated.This method is deprecated and will be removed in a future version. This method has been moved toStringUtilities.removeLeadingAndTrailingQuotes(String)
. -
findClosest
@Deprecated public static <T> T findClosest(Class<?> clazz, Map<Class<?>, T> workerClasses, T defaultClass) Deprecated.This method is deprecated and will be removed in a future version. UseClassUtilities.findClosest(Class, Map, Object)
directly instead. -
setUseUnsafe
Deprecated.This method is deprecated and will be removed in a future version. Use ClassUtilities.setUseUnsafe(boolean) going forward. -
newInstance
@Deprecated public static Object newInstance(com.cedarsoftware.util.convert.Converter converter, Class<?> c, Collection<?> argumentValues) Deprecated.This method is deprecated and will be removed in a future version. Use ClassUtilities.newInstance(Converter, Class, Collection) going forward. -
safelyIgnoreException
Deprecated.This method is deprecated and will be removed in a future version. Use ExceptionUtilities.safelyIgnoreException(Callable, T) -
safelyIgnoreException
Deprecated.This method is deprecated and will be removed in a future version. Use ExceptionUtilities.safelyIgnoreException(Runnable) -
length
Deprecated.This method is deprecated and will be removed in a future version. UseStringUtilities.length(String)
to safely determine the length of a string without risking aNullPointerException
. -
trimLength
Deprecated.This method is deprecated and will be removed in a future version. UseStringUtilities.trimLength(String)
directly instead. -
getClassIfEnum
Deprecated.This method is deprecated and will be removed in a future version. UseClassUtilities.getClassIfEnum(Class)
directly instead. -
isPrimitive
Deprecated.This method is deprecated and will be removed in a future version. UseClassUtilities.isPrimitive(Class)
directly instead. -
trySetAccessible
Deprecated.This method is deprecated and will be removed in a future version. UseExceptionUtilities.safelyIgnoreException(Runnable)
directly instead.
-