상속: global::java.lang.Object
		/// <summary>
		/// Constructs a new
		/// <code>EnumConstantNotPresentException</code>
		/// with the current
		/// stack trace and a detail message based on the specified enum type and
		/// missing constant name.
		/// </summary>
		/// <param name="enumType">the enum type.</param>
		/// <param name="constantName">the missing constant name.</param>
		public EnumConstantNotPresentException(System.Type enumType_1, string constantName_1
			) : base("enum constant " + enumType_1.FullName + "." + constantName_1 + " is missing"
			)
		{
			this._enumType = enumType_1;
			this._constantName = constantName_1;
		}
예제 #2
0
        void AddGlobalMethodsFromStaticMethodsInType(System.Type type, params string[] methodNames)
        {
            MethodInfo[] methods;
            var query = type.GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m);
            if( methodNames.Length > 0 ) 
                query = query.Where(m => methodNames.Contains(m.Name));

            methods = query.ToArray();

            Class javaClass = type;
            foreach (var method in methods)
            {
                Member methodMember = javaClass.getMethod(method.Name, GetParametersForMethod(method));
                var functionName = method.Name.ToCamelCase();
                Scriptable methodFunction = new FunctionObject(functionName, methodMember, _scope);
                _scope.put(functionName, _scope, methodFunction);
            }
        }
예제 #3
0
        public void SUTimeDefautTest()
        {
            var pipeline = new AnnotationPipeline();
            pipeline.addAnnotator(new PTBTokenizerAnnotator(false));
            pipeline.addAnnotator(new WordsToSentencesAnnotator(false));

            var tagger =
                new MaxentTagger(
                    Config.GetModel(@"pos-tagger\english-bidirectional\english-bidirectional-distsim.tagger"));
            pipeline.addAnnotator(new POSTaggerAnnotator(tagger));

            var sutimeRules = new[] {
                                      Config.GetModel(@"sutime\defs.sutime.txt"),
                                      Config.GetModel(@"sutime\english.holidays.sutime.txt"),
                                      Config.GetModel(@"sutime\english.sutime.txt")
                                  };

            var props = new Properties();
            props.setProperty("sutime.rules", String.Join(",", sutimeRules));
            props.setProperty("sutime.binders", "0");
            pipeline.addAnnotator(new TimeAnnotator("sutime", props));

            const string text = "Three interesting dates are 18 Feb 1997, the 20th of july and 4 days from today.";
            var annotation = new Annotation(text);
            annotation.set(new CoreAnnotations.DocDateAnnotation().getClass(), "2013-07-14");
            pipeline.annotate(annotation);

            Console.WriteLine(annotation.get(new CoreAnnotations.TextAnnotation().getClass())+"\n");
            var timexAnnsAll = (ArrayList)annotation.get(new TimeAnnotations.TimexAnnotations().getClass());
            foreach (CoreMap cm in timexAnnsAll)
            {
                var tokens = (java.util.List)cm.get(new CoreAnnotations.TokensAnnotation().getClass());
                var first = tokens.get(0);
                var last = tokens.get(tokens.size() - 1);
                var time = (TimeExpression)cm.get(new TimeExpression.Annotation().getClass());
                Console.WriteLine("{0} [from char offset '{1}' to '{2}'] --> {3}",
                    cm, first, last, (time.getTemporal()));
            }
        }
예제 #4
0
 public void AddPackageFromXml(System.IO.Stream xmlStream)
 {
     _javaPackageBuilder.addPackageFromXml(DroolsDotnetUtil.getJavaStringReaderFromSystemStream(xmlStream));
 }
		/// <summary>
		/// Constructs a new
		/// <code>UnsupportedOperationException</code>
		/// with the current
		/// stack trace, the specified detail message and the specified cause.
		/// </summary>
		/// <param name="message">the detail message for this exception.</param>
		/// <param name="cause">
		/// the optional cause of this exception, may be
		/// <code>null</code>
		/// .
		/// </param>
		/// <since>1.5</since>
		public NotSupportedException(string message, System.Exception cause) : base(message
			, cause)
		{
		}
예제 #6
0
		/// <summary>
		/// Constructs a new
		/// <code>SecurityException</code>
		/// with the current stack trace
		/// and the specified cause.
		/// </summary>
		/// <param name="cause">
		/// the optional cause of this exception, may be
		/// <code>null</code>
		/// .
		/// </param>
		/// <since>1.5</since>
		public SecurityException(System.Exception cause) : base((cause == null ? null : cause
			.ToString()), cause)
		{
		}
예제 #7
0
 protected UnsatisfiedLinkError(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context) { }
예제 #8
0
 protected RuntimeException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context) { }
예제 #9
0
 public ThrowableException(string message, System.Exception inner) : base(message, inner) { }
예제 #10
0
		/// <summary>
		/// Constructs a new
		/// <code>IllegalStateException</code>
		/// with the current stack
		/// trace and the specified cause.
		/// </summary>
		/// <param name="cause">
		/// the cause of this exception, may be
		/// <code>null</code>
		/// .
		/// </param>
		/// <since>1.5</since>
		public InvalidOperationException(System.Exception cause) : base((cause == null ? 
			null : cause.ToString()), cause)
		{
		}
예제 #11
0
        public static ListTypeMapEntry GetValidMapping(Type targetType)
        {
            var mappings = new[]
            {
                //new ListTypeMapEntry(targetType, typeof(System.Array), "IList", "ListWrapper", "ShallowListWrapper"),
                new ListTypeMapEntry(targetType, typeof(List), "IList", "ListWrapper", "ShallowListWrapper"),
                new ListTypeMapEntry(
                    targetType, typeof(Collection), "ICollection", "CollectionWrapper", "ShallowCollectionWrapper"),
                new ListTypeMapEntry(
                    targetType, typeof(Iterable), "IEnumerable", "IterableWrapper", "ShallowIterableWrapper"),
                new ListTypeMapEntry(
                    targetType, typeof(NodeList), "IList", "NodeListWrapper", "SHALLOW NODELIST NOT SUPPORTED!"),
                //new ListTypeMapEntry(
                //    targetType, typeof(Map), "IDictionary", "MapWrapper", "ShallowMapWrapper"),
            };

            return mappings.FirstOrDefault(m => m.IsValidMapping);
        }
예제 #12
0
 public ParsingException(System.Exception exception) 
     : base(exception) 
 { }
예제 #13
0
 public void AddPackageFromDrl(System.IO.Stream drlStream, System.IO.Stream dslStream)
 {
     _javaPackageBuilder.addPackageFromDrl(DroolsDotnetUtil.getJavaStringReaderFromSystemStream(drlStream), DroolsDotnetUtil.getJavaStringReaderFromSystemStream(dslStream));
 }
예제 #14
0
 public void AddPackageFromDrl(string fileName, System.IO.Stream drlStream)
 {
     _javaPackageBuilder.addPackageFromDrl(fileName, DroolsDotnetUtil.getJavaStringReaderFromSystemStream(drlStream));
 }
예제 #15
0
 public void AddPackageFromDrl(System.IO.Stream drlStream)
 {
     AddPackageFromDrl("", drlStream);
 }
예제 #16
0
 public CharacterImpl(System.Char val) : base() {
     m_value = val;
 }
예제 #17
0
		/// <summary>
		/// Constructs a new
		/// <code>IllegalStateException</code>
		/// with the current stack
		/// trace, the specified detail message and the specified cause.
		/// </summary>
		/// <param name="message">the detail message for this exception.</param>
		/// <param name="cause">the cause of this exception.</param>
		/// <since>1.5</since>
		public InvalidOperationException(string message, System.Exception cause) : base(message
			, cause)
		{
		}
예제 #18
0
 public _ByteImpl(System.Byte val) : base() {
     m_value = val;
 }
예제 #19
0
		/// <summary>
		/// Constructs a new
		/// <code>AssertionError</code>
		/// with the given detail message and cause.
		/// </summary>
		/// <since>1.7</since>
		/// <hide>1.7</hide>
		public AssertionError(string detailMessage, System.Exception cause) : base(detailMessage
			, cause)
		{
		}
예제 #20
0
 public _ShortImpl(System.Int16 val) : base() {
     m_value = val;
 }
예제 #21
0
 public RuntimeException(string message, System.Exception inner) : base(message, inner) { }
예제 #22
0
 public _LongImpl(System.Int64 val) : base() {
     m_value = val;
 }
예제 #23
0
 public UnsatisfiedLinkError(string message, System.Exception inner) : base(message, inner) { }
예제 #24
0
 public _IntegerImpl(System.Int32 val) : base() {
     m_value = val;
 }
예제 #25
0
		/// <summary>
		/// Constructs a new
		/// <code>SecurityException</code>
		/// with the current stack trace,
		/// the specified detail message and the specified cause.
		/// </summary>
		/// <param name="message">the detail message for this exception.</param>
		/// <param name="cause">
		/// the optional cause of this exception, may be
		/// <code>null</code>
		/// .
		/// </param>
		/// <since>1.5</since>
		public SecurityException(string message, System.Exception cause) : base(message, 
			cause)
		{
		}
예제 #26
0
 public _DoubleImpl(System.Double val) : base() {
     m_value = val;
 }
예제 #27
0
 public _BooleanImpl(System.Boolean val) : base() {
     m_value = val;
 }
예제 #28
0
 public _FloatImpl(System.Single val) : base() {
     m_value = val;
 }
		/// <summary>
		/// Constructs a new
		/// <code>UnsupportedOperationException</code>
		/// with the current
		/// stack trace and the specified cause.
		/// </summary>
		/// <param name="cause">
		/// the optional cause of this exception, may be
		/// <code>null</code>
		/// .
		/// </param>
		/// <since>1.5</since>
		public NotSupportedException(System.Exception cause) : base((cause == null ? null
			 : cause.ToString()), cause)
		{
		}
예제 #30
0
		/// <summary>
		/// Constructs a new
		/// <code>TypeNotPresentException</code>
		/// with the current stack
		/// trace, a detail message that includes the name of the type that could not
		/// be found and the
		/// <code>Throwable</code>
		/// that caused this exception.
		/// </summary>
		/// <param name="typeName">the fully qualified name of the type that could not be found.
		/// 	</param>
		/// <param name="cause">
		/// the optional cause of this exception, may be
		/// <code>null</code>
		/// .
		/// </param>
		public TypeNotPresentException(string typeName_1, System.Exception cause) : base(
			"Type " + typeName_1 + " not present", cause)
		{
			this._typeName = typeName_1;
		}