?? memberpropertycustom.java
字號:
/*Copyright (c) 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.generator;import org.jibx.binding.model.IClassItem;import org.jibx.runtime.IUnmarshallingContext;import org.jibx.runtime.JiBXException;/** * Member property customization information. */public class MemberPropertyCustom extends MemberCustom{ // values specific to member level private String m_getName; private String m_setName; /** * Constructor. * * @param parent */ protected MemberPropertyCustom(NestingBase parent) { super(parent); } /** * Constructor with name known. * * @param parent * @param name */ protected MemberPropertyCustom(NestingBase parent, String name) { super(parent, name); } /** * Check if collection member. * * @return <code>false</code> */ public boolean isCollection() { return false; } /** * Get 'get' method name. * * @return 'get' method name (<code>null</code> if none) */ public String getGetName() { return m_getName; } /** * Get 'set' method name. * * @return 'set' method name (<code>null</code> if none) */ public String getSetName() { return m_setName; } /** * Post-set method that converts the get/set method names to a member name. * * @throws JiBXException */ protected void postset() throws JiBXException { if (m_getName == null && m_setName == null) { throw new JiBXException("'get-name' or 'set-name' attribute is required for <property> element"); } else { if (m_setName == null) { setBaseName(memberNameFromGetMethod(m_getName)); } else { setBaseName(memberNameFromSetMethod(m_setName)); } } } /** * Complete customization information based on access method information. * * @param gmeth read access method (<code>null</code> if none) * @param smeth write access method (<code>null</code> if none) * @param type value type * @param req required member flag (<code>null</code> if unknown) */ /*package*/ void completeProperty(IClassItem gmeth, IClassItem smeth, String type, Boolean req) { if (m_getName == null && gmeth != null) { m_getName = gmeth.getName(); } if (m_setName == null && smeth != null) { m_setName = smeth.getName(); } complete(type, req); } private static MemberPropertyCustom factory(IUnmarshallingContext ictx) { return new MemberPropertyCustom(getContainingClass(ictx)); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -