protected static String createMissingFactoryMethodMessage(Class<?> type, Class<?> objectFactory) { StringBuilder messageBuilder = new StringBuilder(); Method[] factoryMethods = objectFactory.getDeclaredMethods(); messageBuilder.append( TransformMessages.MESSAGES.noJAXBElementFactoryDefined( type.getName(), objectFactory.getName())); for (Method factoryMethod : factoryMethods) { XmlElementDecl xmlElementDecl = factoryMethod.getAnnotation(XmlElementDecl.class); if (xmlElementDecl != null) { Class<?>[] factoryParams = factoryMethod.getParameterTypes(); if (factoryParams.length == 1) { QName qName = new QName(xmlElementDecl.namespace(), xmlElementDecl.name()); Class<?> factoryParam = factoryParams[0]; messageBuilder.append( "\n\t\t- Message QName: '" + qName.toString() + "'. Java Type: " + factoryParam.getName()); } } } return messageBuilder.toString(); }
private static QName getTypeXMLQName(Class<?> type, Class<?> objectFactory) throws SwitchYardException { Method[] factoryMethods = objectFactory.getDeclaredMethods(); for (Method factoryMethod : factoryMethods) { XmlElementDecl xmlElementDecl = factoryMethod.getAnnotation(XmlElementDecl.class); if (xmlElementDecl != null) { Class<?>[] factoryParams = factoryMethod.getParameterTypes(); if (factoryParams.length == 1) { QName qName = new QName(xmlElementDecl.namespace(), xmlElementDecl.name()); Class<?> factoryParam = factoryParams[0]; if (factoryParam == type) { // This is the factory method for the specified type... return qName; } } } } return null; }
public String substitutionHeadName() { return core.substitutionHeadName(); }
public Class scope() { return core.scope(); }
public String defaultValue() { return core.defaultValue(); }
public String namespace() { return core.namespace(); }