/** * Returns true if the specified class is literalizable. * * @param clazz * the class, interface or superclass to be tested if literalizable * * @return true if the specified class is literalizable * * @see #addLiteralizableClass(MetaClass) */ public boolean isLiteralizableClass(final MetaClass clazz) { checkThread(); return getLiteralizableTargetType(clazz) != null; }
/** * Returns true if the specified class is literalizable. * * @param clazz * the class, interface or superclass to be tested if literalizable * * @return true if the specified class is literalizable * * @see #addLiteralizableClass(MetaClass) */ public boolean isLiteralizableClass(final MetaClass clazz) { checkThread(); return getLiteralizableTargetType(clazz) != null; }
@Override public String getCanonicalString(final Context context) { final Class<?> targetType = context.getLiteralizableTargetType(o.getClass()); return SnapshotMaker.makeSnapshotAsSubclass(o, targetType, targetType, null).generate(context); } };
@Override public String getCanonicalString(final Context context) { final Class<?> targetType = context.getLiteralizableTargetType(o.getClass()); return SnapshotMaker.makeSnapshotAsSubclass(o, targetType, targetType, null).generate(context); } };
/** * Returns the literalizable target type for any matching subtype. Meaning, that if say, the type * <tt com.bar.FooImpl</tt> is a subtype of the interface <tt>com.bar.Foo</tt>, which is itself marked literalizable, * this method will return a reference to the <tt>java.lang.Class</tt> instance for <tt>com.bar.Foo</tt> * * @param clazz * the class, interface or superclass to obtain a literalizable target type for. * @param clazz * . If there are no matches, returns <tt>null</tt>. * * @return the literalizable target type that matches */ public Class<?> getLiteralizableTargetType(final Class<?> clazz) { checkThread(); return getLiteralizableTargetType(MetaClassFactory.get(clazz)); }
/** * Returns the literalizable target type for any matching subtype. Meaning, that if say, the type * <tt com.bar.FooImpl</tt> is a subtype of the interface <tt>com.bar.Foo</tt>, which is itself marked literalizable, * this method will return a reference to the <tt>java.lang.Class</tt> instance for <tt>com.bar.Foo</tt> * * @param clazz * the class, interface or superclass to obtain a literalizable target type for. * @param clazz * . If there are no matches, returns <tt>null</tt>. * * @return the literalizable target type that matches */ public Class<?> getLiteralizableTargetType(final Class<?> clazz) { checkThread(); return getLiteralizableTargetType(MetaClassFactory.get(clazz)); }