com.sun.faces.application
public class ConverterPropertyEditorFactory extends java.lang.Object
Factory for dynamically generating PropertyEditor classes that extend
ConverterPropertyEditorBase
and replace any references to the target
class from the template with a supplied target class.
Modifier and Type | Class and Description |
---|---|
private static class |
ConverterPropertyEditorFactory.ClassTemplateInfo
Capture information extracted from a "template" PropertyEditor class, and
perform manipulation of the byte codes in order to generate the bytes for
a new PropertyEditor class.
|
private class |
ConverterPropertyEditorFactory.DisposableClassLoader
A custom class loader for the definition of the generated classes.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.ClassLoader,java.lang.ref.WeakReference<ConverterPropertyEditorFactory.DisposableClassLoader>> |
classLoaderCache |
private static ConverterPropertyEditorFactory |
defaultInstance |
private static java.util.logging.Logger |
LOGGER |
private static java.util.regex.Pattern |
MultipleUnderscorePattern |
private static java.util.Map<java.lang.Character,java.lang.String> |
PRIM_MAP |
private static java.util.regex.Pattern |
SingleUnderscorePattern |
private ConverterPropertyEditorFactory.ClassTemplateInfo |
templateInfo |
private static java.util.regex.Pattern |
UnderscorePattern |
Constructor and Description |
---|
ConverterPropertyEditorFactory()
Create a
ConverterPropertyEditorFactory that uses the
default template class (ConverterPropertyEditorFor_XXXX ). |
ConverterPropertyEditorFactory(java.lang.Class<? extends ConverterPropertyEditorBase> templateClass)
Create a
ConverterPropertyEditorFactory that uses the
specified template class. |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends ConverterPropertyEditorBase> |
definePropertyEditorClassFor(java.lang.Class<?> targetClass)
Return a PropertyEditor class appropriate for editing the given
targetClass . |
static ConverterPropertyEditorFactory |
getDefaultInstance() |
private ConverterPropertyEditorFactory.ClassTemplateInfo |
getTemplateInfo() |
private static byte[] |
getUtf8InfoBytes(java.lang.String text)
Create a UTF8Info constant pool structure for the given text.
|
private static java.lang.String |
getVMClassName(java.lang.Class<?> c) |
private static final java.util.logging.Logger LOGGER
private static final java.util.regex.Pattern UnderscorePattern
private static final java.util.regex.Pattern SingleUnderscorePattern
private static final java.util.regex.Pattern MultipleUnderscorePattern
private static ConverterPropertyEditorFactory defaultInstance
private ConverterPropertyEditorFactory.ClassTemplateInfo templateInfo
private java.util.Map<java.lang.ClassLoader,java.lang.ref.WeakReference<ConverterPropertyEditorFactory.DisposableClassLoader>> classLoaderCache
private static final java.util.Map<java.lang.Character,java.lang.String> PRIM_MAP
public ConverterPropertyEditorFactory()
ConverterPropertyEditorFactory
that uses the
default template class (ConverterPropertyEditorFor_XXXX
).public ConverterPropertyEditorFactory(java.lang.Class<? extends ConverterPropertyEditorBase> templateClass)
ConverterPropertyEditorFactory
that uses the
specified template class.templateClass
- the templatepublic static ConverterPropertyEditorFactory getDefaultInstance()
private ConverterPropertyEditorFactory.ClassTemplateInfo getTemplateInfo()
public java.lang.Class<? extends ConverterPropertyEditorBase> definePropertyEditorClassFor(java.lang.Class<?> targetClass)
targetClass
. The new class will be defined from a
ConverterPropertyEditorFactory.DisposableClassLoader
.targetClass
- the class of object that the returned property editor class
will be editing.private static java.lang.String getVMClassName(java.lang.Class<?> c)
c
- the class to find the name of.private static byte[] getUtf8InfoBytes(java.lang.String text)
text
- the text to create the UTF8 constant from.Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.