Class Resolver

java.lang.Object
org.jmol.adapter.smarter.Resolver

public class Resolver extends Object
  • Constructor Details

    • Resolver

      public Resolver()
  • Method Details

    • getReaderClassBase

      public static final String getReaderClassBase(String type)
    • getFileType

      public static String getFileType(BufferedReader br)
      From SmarterJmolAdapter.getFileTypeName(Object ascOrReader) just return the file type with no exception issues
      Parameters:
      br -
      Returns:
      String file type
    • getReader

      public static Object getReader(String readerName, Map<String,Object> htParams)
      Get a reader based on its name.
      Parameters:
      readerName -
      htParams -
      Returns:
      AtomSetCollectionReader or error message
    • DOMResolve

      public static Object DOMResolve(Map<String,Object> htParams) throws Exception
      a largely untested reader of the DOM - where in a browser there is model actually in XML format already present on the page. -- Egon Willighagen
      Parameters:
      htParams -
      Returns:
      an AtomSetCollection or a String error
      Throws:
      Exception
    • determineAtomSetCollectionReader

      public static String determineAtomSetCollectionReader(Object readerOrDocument, Map<String,Object> htParams) throws Exception
      the main resolver method. One of the great advantages of Jmol is that it can smartly determine a file type from its contents. In cases where this is not possible, one can force a file type using a prefix to a filename. For example: load mol2::xxxx.whatever This is only necessary for a few file types, where only numbers are involved -- molecular dynamics coordinate files, for instance (mdcrd).
      Parameters:
      readerOrDocument -
      htParams -
      Returns:
      readerName or a few lines, if requested, or null
      Throws:
      Exception
    • getBinaryType

      public static String getBinaryType(InputStream inputStream)
    • checkBCIF

      public static boolean checkBCIF(byte[] magic, boolean forCoord)
    • getFileTypefromFilter

      public static String getFileTypefromFilter(String filter)
    • fixDOSName

      public static String fixDOSName(String fileName)