示例#1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void read(org.w3c.dom.Element chartElem, org.maltparser.core.flow.system.FlowChartSystem flowChartSystem) throws org.maltparser.core.exception.MaltChainedException
        public virtual void read(Element chartElem, FlowChartSystem flowChartSystem)
        {
            Item = chartElem.getAttribute("item");
            string chartItemClassName = chartElem.getAttribute("class");
            Type   clazz = null;

            try
            {
                if (PluginLoader.instance() != null)
                {
                    clazz = PluginLoader.instance().getClass(chartItemClassName);
                }
                if (clazz == null)
                {
                    clazz = Type.GetType(chartItemClassName);
                }
                chartItemClass = clazz.asSubclass(typeof(ChartItem));
            }
            catch (InvalidCastException e)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                throw new FlowException("The class '" + clazz.FullName + "' is not a subclass of '" + typeof(ChartItem).FullName + "'. ", e);
            }
            catch (ClassNotFoundException e)
            {
                throw new FlowException("The class " + chartItemClassName + "  could not be found. ", e);
            }
            NodeList attrElements = chartElem.getElementsByTagName("attribute");

            for (int i = 0; i < attrElements.Length; i++)
            {
                ChartAttribute attribute = new ChartAttribute();
                attribute.read((Element)attrElements.item(i), flowChartSystem);
                attributes.put(((Element)attrElements.item(i)).getAttribute("name"), attribute);
            }
        }