Class CSharp

java.lang.Object
net.sf.saxon.transpile.CSharp

public class CSharp extends Object
This class contains dummy methods which, if called, have no effect; but calls on these methods are detected by the Java-to-C# converter and affect the C# code that is generated.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    constructorRef(T methodReference, int arity)
    CSharp.constructor is an identity function that signals to the CSharp transpiler that the argument expression is a method reference to a constructor with a specified number of arguments.
    static void
    CSharp.emitCode("goto label") causes the converter to include the code "goto label" in the generated C# code.
    static <T> T
    methodRef(T methodReference)
    CSharp.methodRef is an identity function that signals to the CSharp transpiler that the argument expression is a non-static method reference.
    static <T> T
    staticRef(T methodReference)
    CSharp.staticRef is an identity function that signals to the CSharp transpiler that the argument expression is a static method reference.

    Methods inherited from class java.lang.Object

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

    • CSharp

      public CSharp()
  • Method Details

    • emitCode

      public static void emitCode(String code)
      CSharp.emitCode("goto label") causes the converter to include the code "goto label" in the generated C# code. The argument must be supplied as a string literal. At run time, the method has no effect.
      Parameters:
      code - the C# code to be emitted.
    • methodRef

      public static <T> T methodRef(T methodReference)
      CSharp.methodRef is an identity function that signals to the CSharp transpiler that the argument expression is a non-static method reference.
      Type Parameters:
      T - the class of the argument
      Parameters:
      methodReference - must be supplied in the form of a method reference object::method
      Returns:
      the argument, unchanged.
    • staticRef

      public static <T> T staticRef(T methodReference)
      CSharp.staticRef is an identity function that signals to the CSharp transpiler that the argument expression is a static method reference.
      Type Parameters:
      T - the class of the argument
      Parameters:
      methodReference - must be supplied in the form of a method reference ClassName::method
      Returns:
      the argument, unchanged.
    • constructorRef

      public static <T> T constructorRef(T methodReference, int arity)
      CSharp.constructor is an identity function that signals to the CSharp transpiler that the argument expression is a method reference to a constructor with a specified number of arguments.
      Type Parameters:
      T - the class of the argument
      Parameters:
      methodReference - must be supplied in the form of a method reference ClassName::new
      arity - the number of arguments in the constructor (must be a numeric literal)
      Returns:
      the argument, unchanged.