Package net.sf.saxon.transpile
This package contains classes that support the transpilation of Saxon Java source code to C#, from which the SaxonCS product is built.
Most of the classes in this package implement Java annotations. These are used, for example,
to define an alternative C# body for a method, or alternative modifiers required by C#,
or to indicate that an enum
class can be converted directly to a C# enum
.
These annotations have no effect on the behaviour of the Java code, but the transpiler
interprets them as directives controlling the generation of C# code.
The class CSharp
contains static methods which are executable, but the Java implementation
of these methods does nothing; the transpiler converts these calls into C# code that fulfils a useful
purpose.
-
ClassDescriptionThis 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.Annotate a Java class or interface to indicate whether the corresponding C# class should be implemented as a delegate.Annotate a Java interface to reference an additional interface with method definitions that will be present in the C# product.Annotate a Java class or interface with C# code that is to be injected literally into the body of the class or interface when converting to C#.This annotation appears on the declaration of a method that creates an instance of an anonymous inner class, and it is used to define what information needs to be passed to the generated C# inner class.This annotation appears on the declation of a method or field if, for some reason, the automatic generation of the correct modifiers for C# produces incorrect results.Annotate a Java class or interface to indicate that the C# directive "#nullable enable" is to be included in the generated C# code.Annotate a Java method to indicate that it is to be dropped from the C# generated code (alternative to conditional exclusion using the preprocessor)Annotate a Java method with C# code that is to be injected literally into the body of the method when converting to C#, replacing the Java method body.Annotation used by the Java-to-C# transpiler: it causes any exception named in a catch clause within a Java method to be replaced by a different exception in the generated C#Annotate a Java method, constructor, or field with C# code that is to replace the entire Java method.Annotate a Java enum to indicate that a simple mapping to a C# enum should be used.This annotation appears on the declation of a method or field if, for some reason, the automatic generation of the correct modifiers for C# produces incorrect results.This annotation appears on the declaration of a class using generic type parameters if the C# code needs to have type bounds that cannot be inferred directly from the Java declaration.