Method from org.apache.geronimo.st.core.jaxb.JAXBUtils Detail: |
public static List<JAXBContext> getJAXBContext() {
List< JAXBContext > contextList = new ArrayList< JAXBContext >();
Collection< IJAXBUtilsProvider > jaxbutils = providers.values();
Iterator< IJAXBUtilsProvider > iterator = jaxbutils.iterator();
while (iterator.hasNext()){
IJAXBUtilsProvider provider = iterator.next();
contextList.add(provider.getJAXBContext());
}
return contextList;
}
|
public static Object getValue(Object element,
String name) throws Exception {
try {
if (String.class.isInstance(element))
return (String)element;
Method method = element.getClass().getMethod( "get" + name, null);
return method.invoke(element, null);
} catch ( Exception e ) {
throw e;
}
}
|
public static void marshalDeploymentPlan(JAXBElement jaxbElement,
IFile file) throws Exception {
IJAXBUtilsProvider provider = getProvider(file);
provider.marshalDeploymentPlan(jaxbElement, file);
}
|
public static void marshalPlugin(JAXBElement jaxbElement,
OutputStream outputStream) throws Exception {
//currently only JAXB21Utils provide this method,so invoke it directly
providers.get("2.1").marshalPlugin(jaxbElement, outputStream);
}
|
public static void setValue(Object element,
String name,
Object value) throws Exception {
try {
Method[] methods = element.getClass().getMethods();
for ( Method method: methods) {
if ( method.getName().equals( "set" + name ) ) {
method.invoke( element, value );
return;
}
}
} catch (Exception e) {
throw e;
}
System.out.println( "============== No such method set" + name + " in class " + element.getClass().getName() );
}
|
public static JAXBElement unmarshalFilterDeploymentPlan(IFile file) throws Exception {
IJAXBUtilsProvider provider = getProvider(file);
return provider.unmarshalFilterDeploymentPlan(file);
}
|
public static JAXBElement unmarshalPlugin(InputStream inputStream) {
//currently only JAXB21Utils provide this method,so invoke it directly
return providers.get("2.1").unmarshalPlugin(inputStream);
}
|