Class XMLSchemaGenerator


  • public class XMLSchemaGenerator
    extends java.lang.Object
    Iterates over all concrete Protocol classes and creates XML schema used for validation of configuration files. https://issues.redhat.com/browse/JGRP-448
    Author:
    Vladimir Blagojevic, Bela Ban
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.Set<java.lang.String> embeddedSchemas  
      protected static java.lang.String[] PACKAGES  
      protected static java.lang.String PROT_PACKAGE  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.util.List<java.lang.Class<?>> findImplementations​(java.util.List<java.lang.Class<?>> classes, java.lang.Class<?> intf)  
      protected static void generateProtocolSchema​(org.w3c.dom.Document xmldoc, org.w3c.dom.Element parent, java.lang.String... suffixes)  
      static java.util.Set<java.lang.Class<?>> getClasses​(java.lang.Class<?> assignableFrom, java.lang.String packageName)  
      static java.util.List<java.lang.Class<?>> getClassesFromPackages​(java.lang.Class<?> cl, java.lang.String... packages)  
      protected static void iterateOverAttributes​(java.lang.Class<?> clazz, java.util.Map<java.lang.String,​org.jgroups.util.XMLSchemaGenerator.DelayingElementWriter> sortedElements, org.w3c.dom.Document xmldoc, org.w3c.dom.Element complexType, java.lang.String prefix)  
      protected static void iterateOverMethods​(java.lang.Class<?> clazz, java.util.Map<java.lang.String,​org.jgroups.util.XMLSchemaGenerator.DelayingElementWriter> sortedElements, org.w3c.dom.Document xmldoc, org.w3c.dom.Element complexType, java.lang.String prefix)  
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PACKAGES

        protected static final java.lang.String[] PACKAGES
      • embeddedSchemas

        protected static final java.util.Set<java.lang.String> embeddedSchemas
    • Constructor Detail

      • XMLSchemaGenerator

        public XMLSchemaGenerator()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
      • getClassesFromPackages

        public static java.util.List<java.lang.Class<?>> getClassesFromPackages​(java.lang.Class<?> cl,
                                                                                java.lang.String... packages)
                                                                         throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • generateProtocolSchema

        protected static void generateProtocolSchema​(org.w3c.dom.Document xmldoc,
                                                     org.w3c.dom.Element parent,
                                                     java.lang.String... suffixes)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findImplementations

        protected static java.util.List<java.lang.Class<?>> findImplementations​(java.util.List<java.lang.Class<?>> classes,
                                                                                java.lang.Class<?> intf)
      • getClasses

        public static java.util.Set<java.lang.Class<?>> getClasses​(java.lang.Class<?> assignableFrom,
                                                                   java.lang.String packageName)
                                                            throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • iterateOverAttributes

        protected static void iterateOverAttributes​(java.lang.Class<?> clazz,
                                                    java.util.Map<java.lang.String,​org.jgroups.util.XMLSchemaGenerator.DelayingElementWriter> sortedElements,
                                                    org.w3c.dom.Document xmldoc,
                                                    org.w3c.dom.Element complexType,
                                                    java.lang.String prefix)
      • iterateOverMethods

        protected static void iterateOverMethods​(java.lang.Class<?> clazz,
                                                 java.util.Map<java.lang.String,​org.jgroups.util.XMLSchemaGenerator.DelayingElementWriter> sortedElements,
                                                 org.w3c.dom.Document xmldoc,
                                                 org.w3c.dom.Element complexType,
                                                 java.lang.String prefix)