001/* 002 * (C) Copyright 2006-2010 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * bstefanescu 018 */ 019package org.nuxeo.connect.update.xml; 020 021import org.nuxeo.common.xmap.annotation.XNode; 022import org.nuxeo.common.xmap.annotation.XObject; 023import org.nuxeo.connect.update.model.Field; 024 025/** 026 * @author <a href="mailto:[email protected]">Bogdan Stefanescu</a> 027 */ 028@XObject 029public class FieldDefinition implements Field { 030 031 @XNode("@name") 032 protected String name; 033 034 @XNode("@type") 035 protected String type; 036 037 @XNode("@required") 038 protected boolean isRequired; 039 040 @XNode("@vertical") 041 protected boolean isVertical; 042 043 @XNode("@readonly") 044 protected boolean isReadOnly; 045 046 @XNode("label") 047 protected String label; 048 049 @XNode("value") 050 protected String value; 051 052 @Override 053 public String getLabel() { 054 return label; 055 } 056 057 @Override 058 public String getName() { 059 return name; 060 } 061 062 @Override 063 public String getType() { 064 return type; 065 } 066 067 @Override 068 public boolean isRequired() { 069 return isRequired; 070 } 071 072 @Override 073 public boolean isVertical() { 074 return isVertical; 075 } 076 077 @Override 078 public boolean isReadOnly() { 079 return isReadOnly; 080 } 081 082 @Override 083 public String getValue() { 084 return value; 085 } 086 087}