<commit_before>//
// NAntContrib
//
// Copyright (C) 2002 <NAME> (<EMAIL>)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//

using System;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using System.Text;
using System.Resources;
using System.Reflection;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections;
using System.Collections.Specialized;

using NAnt.Core;
using NAnt.Core.Tasks;
using NAnt.Core.Attributes;

namespace NAnt.Contrib.Tasks {
    /// <summary>
    /// Abstract <see cref="Task" /> that validates inheriting classes against 
    /// an XML schema of the same name.
    /// </summary>
    public abstract class SchemaValidatedTask : Task {
        #region Private Instance Fields

        private object _schemaObject;
        private bool _validated = true;
        private ArrayList _validationExceptions = new ArrayList();
        private XmlNode _xmlNode;

        #endregion Private Instance Fields

        #region Public Instance Properties

        /// <summary>
        /// Returns the object from the Schema wrapper after 
        /// <see cref="InitializeTask"/> is called.
        /// </summary>
        /// <value>The object from the Schema wrapper after <see cref="InitializeTask"/> is called.</value>
        public Object SchemaObject {
            get { return _schemaObject; }
        }

        #endregion Public Instance Properties

        #region Protected Instance Properties

        protected override XmlNode XmlNode {
            get { return _xmlNode; }
        }

        #endregion Protected Instance Properties

        #region Override implementation of Task

        /// <summary>
        /// Initializes the task and verifies parameters.
        /// </summary>
        /// <param name="TaskNode">Node that contains the XML fragment used to define this task instance.</param>
        protected override void InitializeTask(XmlNode TaskNode) {
            _xmlNode = TaskNode;
            XmlNode taskNode = TaskNode.Clone();

            // Expand all properties in the task and its child elements
            if (taskNode.ChildNodes != null) {
                ExpandPropertiesInNodes(taskNode.ChildNodes);
                if (taskNode.Attributes != null) {<commit_msg>no longer override protected XmlNode property, hope this is ok ...<commit_after>//
// NAntContrib
//
// Copyright (C) 2002 <NAME> (<EMAIL>)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//

using System;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using System.Text;
using System.Resources;
using System.Reflection;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections;
using System.Collections.Specialized;

using NAnt.Core;
using NAnt.Core.Tasks;
using NAnt.Core.Attributes;

namespace NAnt.Contrib.Tasks {
    /// <summary>
    /// Abstract <see cref="Task" /> that validates inheriting classes against 
    /// an XML schema of the same name.
    /// </summary>
    public abstract class SchemaValidatedTask : Task {
        #region Private Instance Fields

        private object _schemaObject;
        private bool _validated = true;
        private ArrayList _validationExceptions = new ArrayList();

        #endregion Private Instance Fields

        #region Public Instance Properties

        /// <summary>
        /// Returns the object from the Schema wrapper after 
        /// <see cref="InitializeTask"/> is called.
        /// </summary>
        /// <value>The object from the Schema wrapper after <see cref="InitializeTask"/> is called.</value>
        public Object SchemaObject {
            get { return _schemaObject; }
        }

        #endregion Public Instance Properties

        #region Override implementation of Task

        /// <summary>
        /// Initializes the task and verifies parameters.
        /// </summary>
        /// <param name="TaskNode">Node that contains the XML fragment used to define this task instance.</param>
        protected override void InitializeTask(XmlNode TaskNode) {
            XmlNode taskNode = TaskNode.Clone();

            // Expand all properties in the task and its child elements
            if (taskNode.ChildNodes != null) {
                ExpandPropertiesInNodes(taskNode.ChildNodes);
                if (taskNode.Attributes != null) {
{'fraction_non_alphanumeric': 0.08668297797972736, 'fraction_numerical': 0.006641034603285564, 'mean_word_length': 2.6545338441890167, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5980031', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1381, 'n_words': 598}