class DefaultMessagesProvider implements MessagesProvider {

	@Override
	public void addMessages(Definition definition) throws WSDLException {
		Types types = definition.getTypes();
		Assert.notNull(types, "No types element present in definition");
		for (Iterator<?> iterator = types.getExtensibilityElements().iterator(); iterator.hasNext();) {
			ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next();
			if (extensibilityElement instanceof Schema) {
				Schema schema = (Schema) extensibilityElement;
				if (schema.getElement() != null) {
					createMessages(definition, schema.getElement());
				}
			}
		}
		if (definition.getMessages().isEmpty() && logger.isWarnEnabled()) {
			logger.warn("No messages were created, make sure the referenced schema(s) contain elements");
		}
	}

}