Class CommandLine

java.lang.Object
org.web3d.x3d.jsail.CommandLine

public class CommandLine
extends java.lang.Object
Concrete class with a main method that provides command-line JAR access to various X3DJSAIL capabilities.

Usage: % java -jar X3DJSAIL.3.3.classes.jar -help
See Also:
X3DJSAIL documentation: Command Line, JAR File Specification, Java Tutorials, Lesson: Packaging Programs in JAR Files, X3D Scene Authoring Hints
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String USAGE
    Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [-help | -version | -home | -javadoc | -resources | -hints | -regexes | -tooltips | -X3DUOM] [-properties [propertiesFile]] [sourceModel.x3d | sourceModel.exi [-fromEXI] | sourceModel.gz [-fromGZIP] | sourceModel.zip [-fromZIP]] [-canonical] [-validate] [-EXIFICIENT | -OpenEXI] | [-Tidy | -toX3D | -toXML | -toClassicVrml | -toJava | -toJSON | -toPython | -toVRML97 | -toHTML | -toX3DOM | -toX_ITE | -toMarkdown | -toEXI | -toGZIP | -toZIP] [-tofile [resultFile.*]] [-toImage [snapshotName.*]]
    static java.lang.String USAGE_LONG  
  • Constructor Summary

    Constructors 
    Constructor Description
    CommandLine()  
  • Method Summary

    Modifier and Type Method Description
    static void clearLoadedX3dModel()
    Reset already-loaded X3D model of interest to empty model
    static java.io.File fileStylesheetConversion​(java.io.File inputFile, java.lang.String stylesheetName, java.lang.String outputFileName)
    Convert file using stylesheet, return result.
    static java.io.File fileStylesheetConversion​(java.lang.String inputFilePath, java.lang.String stylesheetName, java.lang.String outputFileName)
    Load file and apply stylesheet conversion to indicated path, return result as file.
    static java.lang.String fileStylesheetConversionToString​(java.io.File inputFile, java.lang.String stylesheetName)
    Convert file using stylesheet, return result.
    protected static java.lang.String getFileContents​(java.io.File inputFile)
    Retrieve file contents as a string.
    protected static java.lang.String getFileContents​(java.lang.String inputFileName)
    Retrieve file contents as a string.
    static void initialize()
    Initialize this CommandLine instance to default values.
    static void main​(java.lang.String[] args)
    Default main() method provided for test and debugging purposes, invoking run() method.
    static void openHomePageX3DJSAIL()
    Open X3DJSAIL page
    static void openHomePageX3DJSAIL​(java.lang.String bookmark)
    Open X3DJSAIL page at a given bookmark
    static void openJavadocX3DJSAIL()
    Open X3DJSAIL Javadoc
    static void openX3dRegexesPage()
    Open X3D Regexes page
    static void openX3dRegexesPage​(java.lang.String bookmark)
    Open X3D Regex page at a given bookmark
    static void openX3dResourcesPage()
    Open X3D Resources page
    static void openX3dResourcesPage​(java.lang.String bookmark)
    Open X3D Resources page at a given bookmark
    static void openX3dSceneAuthoringHintsPage()
    Open X3D Scene Authoring Hints page
    static void openX3dSceneAuthoringHintsPage​(java.lang.String bookmark)
    Open X3D Scene Authoring Hints page at a given bookmark
    static void openX3dTooltipsPage()
    Open X3D Tooltips page
    static void openX3dTooltipsPage​(java.lang.String bookmark)
    Open X3D Tooltips page at a given bookmark
    static void openX3DUOMpage()
    Open X3D Unified Object Model (X3DUOM) page
    static void run​(java.lang.String arguments)
    Utility run() method provided for test and debugging purposes, allowing invocation with a single String (rather than a String[] array).
    static void run​(java.lang.String[] args)
    Default run() method provided for test and debugging purposes, first initializing ConfigurationProperties then reading properties file (if any) and processing arguments.
    static void setLoadedX3dModel​(X3DObject newX3dModel)
    Set already-loaded X3D model of interest, useful for initialization and use of CommandLine by other X3D Java programs.

    Methods inherited from class java.lang.Object

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

    • USAGE

      public static final java.lang.String USAGE
      Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [-help | -version | -home | -javadoc | -resources | -hints | -regexes | -tooltips | -X3DUOM] [-properties [propertiesFile]] [sourceModel.x3d | sourceModel.exi [-fromEXI] | sourceModel.gz [-fromGZIP] | sourceModel.zip [-fromZIP]] [-canonical] [-validate] [-EXIFICIENT | -OpenEXI] | [-Tidy | -toX3D | -toXML | -toClassicVrml | -toJava | -toJSON | -toPython | -toVRML97 | -toHTML | -toX3DOM | -toX_ITE | -toMarkdown | -toEXI | -toGZIP | -toZIP] [-tofile [resultFile.*]] [-toImage [snapshotName.*]]
      See Also:
      Constant Field Values
    • USAGE_LONG

      public static final java.lang.String USAGE_LONG
      See Also:
      Constant Field Values
  • Constructor Details

  • Method Details

    • setLoadedX3dModel

      public static void setLoadedX3dModel​(X3DObject newX3dModel)
      Set already-loaded X3D model of interest, useful for initialization and use of CommandLine by other X3D Java programs.
      Parameters:
      newX3dModel - already-loaded X3D model of interest
    • clearLoadedX3dModel

      public static void clearLoadedX3dModel()
      Reset already-loaded X3D model of interest to empty model
    • initialize

      public static final void initialize()
      Initialize this CommandLine instance to default values.
    • main

      public static void main​(java.lang.String[] args)
      Default main() method provided for test and debugging purposes, invoking run() method.
      Parameters:
      args - the command line arguments
      See Also:
      run(String[]), X3DObject.handleArguments(String[])
    • run

      public static void run​(java.lang.String arguments)
      Utility run() method provided for test and debugging purposes, allowing invocation with a single String (rather than a String[] array). When invoked without parameters then reports results of validate() self-checks to system output.
      Parameters:
      arguments - the command line arguments
      See Also:
      run(String[])
    • run

      public static void run​(java.lang.String[] args)
      Default run() method provided for test and debugging purposes, first initializing ConfigurationProperties then reading properties file (if any) and processing arguments. When invoked without parameters then reports results of validate() self-checks to system output.
      Parameters:
      args - the command line arguments
      See Also:
      main(String[]), ConfigurationProperties, X3DObject.handleArguments(String[])
    • openJavadocX3DJSAIL

      public static void openJavadocX3DJSAIL()
      Open X3DJSAIL Javadoc
      See Also:
      X3DJSAIL Javadoc (relative), X3DJSAIL Javadoc (online), https://www.web3d.org/specifications/java/X3DJSAIL.html
    • openHomePageX3DJSAIL

      public static void openHomePageX3DJSAIL()
      Open X3DJSAIL page
      See Also:
      https://www.web3d.org/specifications/java/X3DJSAIL.html
    • openHomePageX3DJSAIL

      public static void openHomePageX3DJSAIL​(java.lang.String bookmark)
      Open X3DJSAIL page at a given bookmark
      Parameters:
      bookmark - anchor bookmark of interest for this page
      See Also:
      https://www.web3d.org/specifications/java/X3DJSAIL.html
    • openX3dResourcesPage

      public static void openX3dResourcesPage()
      Open X3D Resources page
      See Also:
      https://www.web3d.org/x3d/content/examples/X3dResources.html
    • openX3dResourcesPage

      public static void openX3dResourcesPage​(java.lang.String bookmark)
      Open X3D Resources page at a given bookmark
      Parameters:
      bookmark - anchor bookmark of interest for this page
      See Also:
      https://www.web3d.org/x3d/content/examples/X3dResources.html
    • openX3dTooltipsPage

      public static void openX3dTooltipsPage()
      Open X3D Tooltips page
      See Also:
      X3D Tooltips
    • openX3dTooltipsPage

      public static void openX3dTooltipsPage​(java.lang.String bookmark)
      Open X3D Tooltips page at a given bookmark
      Parameters:
      bookmark - anchor bookmark of interest for this page
      See Also:
      X3D Tooltips
    • openX3dRegexesPage

      public static void openX3dRegexesPage()
      Open X3D Regexes page
      See Also:
      X3D Regular Expressions (regexes)
    • openX3dRegexesPage

      public static void openX3dRegexesPage​(java.lang.String bookmark)
      Open X3D Regex page at a given bookmark
      Parameters:
      bookmark - anchor bookmark of interest for this page
      See Also:
      X3D Regular Expressions (regexes), ConfigurationProperties.URL_X3DREGEXES
    • openX3DUOMpage

      public static void openX3DUOMpage()
      Open X3D Unified Object Model (X3DUOM) page
      See Also:
      X3D Tooltips
    • openX3dSceneAuthoringHintsPage

      public static void openX3dSceneAuthoringHintsPage()
      Open X3D Scene Authoring Hints page
      See Also:
      X3D Scene Authoring Hints
    • openX3dSceneAuthoringHintsPage

      public static void openX3dSceneAuthoringHintsPage​(java.lang.String bookmark)
      Open X3D Scene Authoring Hints page at a given bookmark
      Parameters:
      bookmark - anchor bookmark of interest for this page
      See Also:
      X3D Scene Authoring Hints
    • fileStylesheetConversion

      public static java.io.File fileStylesheetConversion​(java.lang.String inputFilePath, java.lang.String stylesheetName, java.lang.String outputFileName)
      Load file and apply stylesheet conversion to indicated path, return result as file.
      Parameters:
      inputFilePath - path and name of XML inputFile
      stylesheetName - XSLT stylesheet to apply
      outputFileName - path and name of resulting outputFile
      Returns:
      output file (if any)
    • fileStylesheetConversionToString

      public static java.lang.String fileStylesheetConversionToString​(java.io.File inputFile, java.lang.String stylesheetName)
      Convert file using stylesheet, return result.
      Parameters:
      inputFile - XML inputFile
      stylesheetName - XSLT stylesheet to apply
      Returns:
      output result (if any)
    • fileStylesheetConversion

      public static java.io.File fileStylesheetConversion​(java.io.File inputFile, java.lang.String stylesheetName, java.lang.String outputFileName)
      Convert file using stylesheet, return result.
      Parameters:
      inputFile - XML inputFile
      stylesheetName - XSLT stylesheet to apply
      outputFileName - path and name of resulting outputFile
      Returns:
      output file (if any)
    • getFileContents

      protected static java.lang.String getFileContents​(java.lang.String inputFileName)
      Retrieve file contents as a string.
      Parameters:
      inputFileName - name of file of interest
      Returns:
      file contents as string
    • getFileContents

      protected static java.lang.String getFileContents​(java.io.File inputFile)
      Retrieve file contents as a string.
      Parameters:
      inputFile - file of interest
      Returns:
      file contents as string