public static ClassLocation getClassLocation ( final Node aNode , final Set < ClassLocation > classLocations ) { if ( aNode != null ) { // The LocalName of the supplied DOM Node should be either "complexType" or "simpleType". final String nodeLocalName = aNode . getLocalName ( ) ; final boolean acceptableType = "complexType" . equalsIgnoreCase ( nodeLocalName ) || "simpleType" . equalsIgnoreCase ( nodeLocalName ) ; if ( acceptableType ) { final String nodeClassName = DomHelper . getNameAttribute ( aNode ) ; for ( ClassLocation current : classLocations ) { // TODO: Ensure that the namespace of the supplied aNode matches the expected namespace. // Issue #25: Handle XML Type renaming. final String effectiveClassName = current . getAnnotationRenamedTo ( ) == null ? current . getClassName ( ) : current . getAnnotationRenamedTo ( ) ; if ( effectiveClassName . equalsIgnoreCase ( nodeClassName ) ) { return current ; } } } } // Nothing found return null ; }
Retrieves the ClassLocation for the supplied aNode .