⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertyattributes.java

📁 对xml很好的java处理引擎,编译中绑定xml
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*Copyright (c) 2004-2007, Dennis M. SosnoskiAll rights reserved.Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this   list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice,   this list of conditions and the following disclaimer in the documentation   and/or other materials provided with the distribution. * Neither the name of JiBX nor the names of its contributors may be used   to endorse or promote products derived from this software without specific   prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FORANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/package org.jibx.binding.model;import java.util.ArrayList;import org.jibx.binding.util.StringArray;import org.jibx.runtime.EnumSet;/** * Model component for <i>property</i> attribute group in binding definition. * * @author Dennis M. Sosnoski */public class PropertyAttributes extends AttributeBase{    /** Enumeration of allowed attribute names */    public static final StringArray s_allowedAttributes =        new StringArray(new String[] { "field", "get-method", "set-method",        "test-method", "type", "usage" });        // recognized test-method signatures.    private static final String[] TEST_METHOD_SIGNATURES =    {        "(Lorg/jibx/runtime/IMarshallingContext;)Z",        "()Z"    };        // recognized get-method signatures.    private static final String[] GET_METHOD_SIGNATURES =    {        "(Lorg/jibx/runtime/IMarshallingContext;)",        "()"    };        //	// Value set information		public static final int REQUIRED_USAGE = 0;	public static final int OPTIONAL_USAGE = 1;    public static final int OPTIONAL_IN_USAGE = 2;    public static final int OPTIONAL_OUT_USAGE = 3;    private static final EnumSet s_usageEnum = new EnumSet(REQUIRED_USAGE,        new String[] { "required", "optional", "opt-in", "opt-out" });		//	// Instance data.		/** Usage type code. */	private int m_usage;        /** Usage name. */    private String m_usageName = s_usageEnum.getName(REQUIRED_USAGE);        /** Property type name. */    private String m_declaredType;        /** Property field name. */    private String m_fieldName;        /** Test method name. */    private String m_testName;        /** Get method name. */    private String m_getName;        /** Set method name. */    private String m_setName;        /** Type for value loaded on stack. */    private IClass m_getType;        /** Type for value stored from stack. */    private IClass m_setType;        /** Property type information. */    private IClass m_type;		/** Property field information. */	private IClassItem m_fieldItem;		/** Test method information. */	private IClassItem m_testItem;		/** Get method information. */	private IClassItem m_getItem;		/** Set method information. */	private IClassItem m_setItem;        /** Flag for no actual property definition. */    private boolean m_isImplicit;        /**     * Get usage name.     *      * @return usage name     */    public String getUsageName() {        return s_usageEnum.getName(m_usage);    }        /**     * Get usage value. This method is only usable after a call to {@link     * #validate}.     *      * @return usage value     */    public int getUsage() {        return m_usage;    }        /**     * Set usage name.     *      * @param name usage name     */    public void setUsageName(String name) {        m_usageName = name;    }        /**     * Set usage value.     *      * @param use value     */    public void setUsage(int use) {        m_usage = use;        m_usageName = s_usageEnum.getName(use);    }        /**     * Check if property is defined. This method is only usable after a call to     * {@link #validate}.     *      * @return <code>true</code> if property defined, <code>false</code> if not     */    public boolean hasProperty() {        return !m_isImplicit && m_type != null;    }        /**     * Get declared type name.     *      * @return declared type name (or <code>null</code> if none)     */    public String getDeclaredType() {        return m_declaredType;    }        /**     * Set declared type name.     *      * @param declared type name (or <code>null</code> if none)     */    public void setDeclaredType(String type) {        m_declaredType = type;    }        /**     * Get field name.     *      * @return field name (or <code>null</code> if none)     */    public String getFieldName() {        return m_fieldName;    }        /**     * Get field information. This method is only usable after a call to {@link     * #validate}.     *      * @return field information (or <code>null</code> if none)     */    public IClassItem getField() {        return m_fieldItem;    }        /**     * Set field name.     *      * @param field field name (or <code>null</code> if none)     */    public void setFieldName(String field) {        m_fieldName = field;    }        /**     * Get test method name.     *      * @return test method name (or <code>null</code> if none)     */    public String getTestName() {        return m_testName;    }		/**	 * Get test method information. This method is only usable after a call to     * {@link #validate}.	 * 	 * @return test method information (or <code>null</code> if none)	 */	public IClassItem getTest() {		return m_testItem;	}		/**	 * Set test method name.	 * 	 * @param test test method name (or <code>null</code> if none)	 */	public void setTestName(String test) {        m_testName = test;	}        /**     * Get get method name.     *      * @return get method name (or <code>null</code> if none)     */    public String getGetName() {        return m_getName;    }		/**	 * Get get method information. This method is only usable after a call to     * {@link #validate}.	 * 	 * @return get method information (or <code>null</code> if none)	 */	public IClassItem getGet() {		return m_getItem;	}        /**     * Get type for value loaded to stack. This method is only usable after a     * call to {@link #validate}.     *      * @return get value type (or <code>null</code> if none)     */    public IClass getGetType() {        return m_getType;    }		/**	 * Set get method name.	 * 	 * @param get get method name (or <code>null</code> if none)	 */	public void setGetName(String get) {        m_getName = get;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -