src/main/java/org/jboss/util/xml/JBossEntityResolver.java
protected InputSource resolvePublicID(String publicId, boolean trace)
   {
      if( publicId == null )
         return null;

      if (trace)
         log.trace("resolvePublicID, publicId=" + publicId);

      InputSource inputSource = null;

      String filename = null;
      if( localEntities != null )
         filename = (String) localEntities.get(publicId);
      if( filename == null )
         filename = (String) entities.get(publicId);

      if( filename != null )
      {
         if (trace)
            log.trace("Found entity from publicId=" + publicId + " fileName=" + filename);

         InputStream ins = loadClasspathResource(filename, trace);
         if( ins != null )
         {
            inputSource = new InputSource(ins);
            inputSource.setPublicId(publicId);
         }
         else
         {
            log.trace("Cannot load publicId from classpath resource: " + filename);
            
            // Try the file name as a URI
            inputSource = resolveSystemIDasURL(filename, trace);
            
            if (inputSource == null)
               log.warn("Cannot load publicId from resource: " + filename);
         }
      }

      return inputSource;
   }
protected InputSource resolvePublicID(String publicId, boolean trace)
   {
      if( publicId == null )
         return null;

      if (trace)
         log.trace("resolvePublicID, publicId=" + publicId);

      InputSource inputSource = null;

      String filename = null;
      if( localEntities != null )
         filename = (String) localEntities.get(publicId);
      if( filename == null )
         filename = (String) entities.get(publicId);

      if( filename != null )
      {
         if (trace)
            log.trace("Found entity from publicId=" + publicId + " fileName=" + filename);

         InputStream ins = loadClasspathResource(filename, trace);
         if( ins != null )
         {
            inputSource = new InputSource(ins);
            inputSource.setPublicId(publicId);
         }
         else
         {
            log.trace("Cannot load publicId from classpath resource: " + filename);
            
            // Try the file name as a URI
            inputSource = resolveSystemIDasURL(filename, trace);
            
            if (inputSource == null)
               log.warn("Cannot load publicId from resource: " + filename);
         }
      }

      return inputSource;
   }
protected InputSource resolvePublicID ( String publicId , boolean trace ) { if ( publicId == null ) return null ; if ( trace ) log . trace ( "resolvePublicID, publicId=" + publicId ) ; InputSource inputSource = null ; String filename = null ; if ( localEntities != null ) filename = ( String ) localEntities . get ( publicId ) ; if ( filename == null ) filename = ( String ) entities . get ( publicId ) ; if ( filename != null ) { if ( trace ) log . trace ( "Found entity from publicId=" + publicId + " fileName=" + filename ) ; InputStream ins = loadClasspathResource ( filename , trace ) ; if ( ins != null ) { inputSource = new InputSource ( ins ) ; inputSource . setPublicId ( publicId ) ; } else { log . trace ( "Cannot load publicId from classpath resource: " + filename ) ; // Try the file name as a URI inputSource = resolveSystemIDasURL ( filename , trace ) ; if ( inputSource == null ) log . warn ( "Cannot load publicId from resource: " + filename ) ; } } return inputSource ; }
Load the schema from the class entity to schema file mapping.
@see #registerEntity(String, String)

@param publicId - the public entity name of the schema
@param trace - trace level logging flag
@return the InputSource for the schema file found on the classpath, null
if the publicId is not registered or found.
Load the schema from the class entity to schema file mapping . @see #registerEntity ( String String )