コード例 #1
0
ファイル: MethodScanner.cs プロジェクト: restlet/simplexml
        /// <summary>
        /// This method is used to remove a particular method from the list
        /// of contacts. If the <c>Transient</c> annotation is used
        /// by any method then this method must be removed from the schema.
        /// In particular it is important to remove methods if there are
        /// defaults applied to the class.
        /// </summary>
        /// <param name="method">
        /// this is the method that is to be removed
        /// </param>
        /// <param name="label">
        /// this is the label associated with the method
        /// </param>
        public void Remove(Method method, Annotation label)
        {
            MethodPart part = factory.GetInstance(method, label);
            MethodType type = part.GetMethodType();

            if (type == MethodType.GET)
            {
                Remove(part, read);
            }
            if (type == MethodType.IS)
            {
                Remove(part, read);
            }
            if (type == MethodType.SET)
            {
                Remove(part, write);
            }
        }
コード例 #2
0
ファイル: MethodScanner.cs プロジェクト: restlet/simplexml
        /// <summary>
        /// This is used to classify the specified method into either a get
        /// or set method. If the method is neither then an exception is
        /// thrown to indicate that the XML annotations can only be used
        /// with methods following the Java Bean naming conventions. Once
        /// the method is classified is is added to either the read or
        /// write map so that it can be paired after scanning is complete.
        /// </summary>
        /// <param name="method">
        /// this is the method that is to be classified
        /// </param>
        public void Process(Method method)
        {
            MethodPart part = factory.GetInstance(method);
            MethodType type = part.GetMethodType();

            if (type == MethodType.GET)
            {
                Process(part, read);
            }
            if (type == MethodType.IS)
            {
                Process(part, read);
            }
            if (type == MethodType.SET)
            {
                Process(part, write);
            }
        }