public class Utilities extends Object
Modifier and Type | Field and Description |
---|---|
static char |
INSTANCE_PATH_SEPARATOR
Separator for instance names
|
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static BaseHK2JAXBBean |
_addRoot(ModelImpl rootNode,
Object rawRoot,
DynamicChangeInfo<?> changeInfo,
ClassReflectionHelper helper,
WriteableBeanDatabase writeableDatabase,
DynamicConfiguration dynamicService,
List<ActiveDescriptor<?>> addedServices,
XmlRootHandleImpl<?> xmlRootHandle)
Called with write lock held
|
static ActiveDescriptor<?> |
advertise(WriteableBeanDatabase wbd,
DynamicConfiguration config,
BaseHK2JAXBBean bean) |
static void |
applyDiff(Differences differences,
DynamicChangeInfo<?> changeControl)
Must have write lock of source held
|
static int |
calculateAddCost(BaseHK2JAXBBean bean)
Calculates and sets the add cost for the given bean
and sets all add costs for this bean and all its
children
|
static void |
calculateNamespaces(BaseHK2JAXBBean bean,
XmlRootHandleImpl<?> root,
Map<String,String> currentValues) |
static String |
constructXmlTag(String wrapper,
String tag) |
static String |
convertNameToString(Name name)
Converts the Name from the Element to a String
|
static String |
convertToSetter(String getterName)
Converts a getter name to a setter name (works with
both IS getters and GET getters)
|
static AltClass |
convertTypeMirror(TypeMirror typeMirror,
ProcessingEnvironment processingEnv) |
static BaseHK2JAXBBean |
createBean(Class<?> implClass) |
static String |
createInstanceName(BaseHK2JAXBBean bean)
Creates an instance name by traveling up the parent chain.
|
static <T> BaseHK2JAXBBean |
doCopy(BaseHK2JAXBBean copyMe,
DynamicChangeInfo<T> copyController,
BaseHK2JAXBBean theCopiedParent,
XmlRootHandleImpl<?> rootHandle,
Map<org.glassfish.hk2.xml.internal.ReferenceKey,BaseHK2JAXBBean> referenceMap,
List<UnresolvedReference> unresolved) |
static void |
fillInUnfinishedReferences(Map<org.glassfish.hk2.xml.internal.ReferenceKey,BaseHK2JAXBBean> referenceMap,
List<UnresolvedReference> unresolved) |
static Method |
findSuitableCustomizerMethod(Class<?> cClass,
String methodName,
Class<?>[] params,
Class<?> topInterface) |
static Object |
getDefaultValue(String givenStringDefault,
Class<?> expectedClass,
Map<String,String> namespaceMap)
Returns the default value given the string version of the default and
the expected result (non-child properties)
|
static Differences |
getDiff(BaseHK2JAXBBean source,
BaseHK2JAXBBean other)
Must have write lock of source held though this is only doing reading
|
static MethodInformationI |
getMethodInformation(AltMethod m,
NameInformation xmlNameMap) |
static String |
getProxyNameFromInterfaceName(String iFaceName)
Given the fully qualified class name of the interface representing a bean,
returns the class name of the proxy
|
static BaseHK2JAXBBean |
internalAdd(BaseHK2JAXBBean myParent,
String childPropertyNamespace,
String childProperty,
Object rawChild,
String childKey,
int index,
DynamicChangeInfo<?> changeInformation,
XmlDynamicChange xmlDynamicChange,
List<ActiveDescriptor<?>> addedServices,
boolean changeList) |
static void |
internalModifyChild(BaseHK2JAXBBean myParent,
String childPropertyNamespace,
String childProperty,
Object currentValue,
Object newValue,
XmlRootHandleImpl<?> root,
DynamicChangeInfo<?> changeInformation,
XmlDynamicChange xmlDynamicChange) |
static BaseHK2JAXBBean |
internalRemove(BaseHK2JAXBBean myParent,
String childPropertyNamespace,
String childProperty,
String childKey,
int index,
Object childToRemove,
DynamicChangeInfo<?> changeInformation,
XmlDynamicChange xmlDynamicChange,
boolean changeList)
Write lock must be held
|
static void |
invokeVetoableChangeListeners(DynamicChangeInfo<?> control,
BaseHK2JAXBBean source,
Object oldValue,
Object newValue,
String propertyName,
ClassReflectionHelper helper) |
static String |
isGetter(AltMethod method) |
static String |
isSetter(AltMethod method) |
static List<AltMethod> |
prioritizeMethods(List<AltMethod> methods,
String[] specifiedOrdering,
NameInformation xmlMap) |
static String |
safeString(String originalValue) |
public static final char INSTANCE_PATH_SEPARATOR
public static BaseHK2JAXBBean createBean(Class<?> implClass)
public static String createInstanceName(BaseHK2JAXBBean bean)
bean
- The non-null bean from where to get the instancenamepublic static ActiveDescriptor<?> advertise(WriteableBeanDatabase wbd, DynamicConfiguration config, BaseHK2JAXBBean bean)
public static String convertToSetter(String getterName)
getterName
- Non-null getter name starting with is or getpublic static String convertNameToString(Name name)
name
- public static AltClass convertTypeMirror(TypeMirror typeMirror, ProcessingEnvironment processingEnv)
public static void internalModifyChild(BaseHK2JAXBBean myParent, String childPropertyNamespace, String childProperty, Object currentValue, Object newValue, XmlRootHandleImpl<?> root, DynamicChangeInfo<?> changeInformation, XmlDynamicChange xmlDynamicChange)
public static BaseHK2JAXBBean internalAdd(BaseHK2JAXBBean myParent, String childPropertyNamespace, String childProperty, Object rawChild, String childKey, int index, DynamicChangeInfo<?> changeInformation, XmlDynamicChange xmlDynamicChange, List<ActiveDescriptor<?>> addedServices, boolean changeList)
public static String getProxyNameFromInterfaceName(String iFaceName)
iFaceName
- the never null fully qualified class name of the bean interfacepublic static BaseHK2JAXBBean _addRoot(ModelImpl rootNode, Object rawRoot, DynamicChangeInfo<?> changeInfo, ClassReflectionHelper helper, WriteableBeanDatabase writeableDatabase, DynamicConfiguration dynamicService, List<ActiveDescriptor<?>> addedServices, XmlRootHandleImpl<?> xmlRootHandle)
rootNode
- rawRoot
- changeInfo
- helper
- writeableDatabase
- dynamicService
- public static BaseHK2JAXBBean internalRemove(BaseHK2JAXBBean myParent, String childPropertyNamespace, String childProperty, String childKey, int index, Object childToRemove, DynamicChangeInfo<?> changeInformation, XmlDynamicChange xmlDynamicChange, boolean changeList)
myParent
- childProperty
- childKey
- index
- changeInformation
- writeableDatabase
- dynamicService
- public static Object getDefaultValue(String givenStringDefault, Class<?> expectedClass, Map<String,String> namespaceMap)
givenStringDefault
- expectedClass
- public static void fillInUnfinishedReferences(Map<org.glassfish.hk2.xml.internal.ReferenceKey,BaseHK2JAXBBean> referenceMap, List<UnresolvedReference> unresolved)
public static Method findSuitableCustomizerMethod(Class<?> cClass, String methodName, Class<?>[] params, Class<?> topInterface)
public static void invokeVetoableChangeListeners(DynamicChangeInfo<?> control, BaseHK2JAXBBean source, Object oldValue, Object newValue, String propertyName, ClassReflectionHelper helper)
public static Differences getDiff(BaseHK2JAXBBean source, BaseHK2JAXBBean other)
classReflectionHelper
- source
- other
- public static void applyDiff(Differences differences, DynamicChangeInfo<?> changeControl)
classReflectionHelper
- source
- other
- public static int calculateAddCost(BaseHK2JAXBBean bean)
bean
- The bean to calculate and set the
add cost onpublic static List<AltMethod> prioritizeMethods(List<AltMethod> methods, String[] specifiedOrdering, NameInformation xmlMap)
public static MethodInformationI getMethodInformation(AltMethod m, NameInformation xmlNameMap)
public static <T> BaseHK2JAXBBean doCopy(BaseHK2JAXBBean copyMe, DynamicChangeInfo<T> copyController, BaseHK2JAXBBean theCopiedParent, XmlRootHandleImpl<?> rootHandle, Map<org.glassfish.hk2.xml.internal.ReferenceKey,BaseHK2JAXBBean> referenceMap, List<UnresolvedReference> unresolved) throws Throwable
Throwable
public static void calculateNamespaces(BaseHK2JAXBBean bean, XmlRootHandleImpl<?> root, Map<String,String> currentValues)
Copyright © 2009–2023 Oracle Corporation. All rights reserved.