@Override public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException {
  if (fEntityResolver != null) {
    LSInput inputSource=resourceIdentifier == null ? fEntityResolver.resolveResource(null,null,null,null,null) : fEntityResolver.resolveResource(getType(resourceIdentifier),resourceIdentifier.getNamespace(),resourceIdentifier.getPublicId(),resourceIdentifier.getLiteralSystemId(),resourceIdentifier.getBaseSystemId());
    if (inputSource != null) {
      String publicId=inputSource.getPublicId();
      String systemId=inputSource.getSystemId();
      String baseSystemId=inputSource.getBaseURI();
      InputStream byteStream=inputSource.getByteStream();
      Reader charStream=inputSource.getCharacterStream();
      String encoding=inputSource.getEncoding();
      String data=inputSource.getStringData();
      XMLInputSource xmlInputSource=new XMLInputSource(publicId,systemId,baseSystemId);
      if (charStream != null) {
        xmlInputSource.setCharacterStream(charStream);
      }
 else       if (byteStream != null) {
        xmlInputSource.setByteStream(byteStream);
      }
 else       if (data != null && data.length() != 0) {
        xmlInputSource.setCharacterStream(new StringReader(data));
      }
      xmlInputSource.setEncoding(encoding);
      return xmlInputSource;
    }
  }
  return null;
}

@ Override public XMLInputSource resolveEntity ( XMLResourceIdentifier resourceIdentifier ) throws XNIException , IOException { if ( fEntityResolver != null ) { LSInput inputSource = resourceIdentifier == null ? fEntityResolver . resolveResource ( null , null , null , null , null ) : fEntityResolver . resolveResource ( getType ( resourceIdentifier ) , resourceIdentifier . getNamespace ( ) , resourceIdentifier . getPublicId ( ) , resourceIdentifier . getLiteralSystemId ( ) , resourceIdentifier . getBaseSystemId ( ) ) ; if ( inputSource != null ) { String publicId = inputSource . getPublicId ( ) ; String systemId = inputSource . getSystemId ( ) ; String baseSystemId = inputSource . getBaseURI ( ) ; InputStream byteStream = inputSource . getByteStream ( ) ; Reader charStream = inputSource . getCharacterStream ( ) ; String encoding = inputSource . getEncoding ( ) ; String data = inputSource . getStringData ( ) ; XMLInputSource xmlInputSource = new XMLInputSource ( publicId , systemId , baseSystemId ) ; if ( charStream != null ) { xmlInputSource . setCharacterStream ( charStream ) ; } else if ( byteStream != null ) { xmlInputSource . setByteStream ( byteStream ) ; } else if ( data != null && data . length ( ) != 0 ) { xmlInputSource . setCharacterStream ( new StringReader ( data ) ) ; } xmlInputSource . setEncoding ( encoding ) ; return xmlInputSource ; } } return null ; }
resolves an external parsed entity . if the entity cannot be resolved , this method should return null .
