Java tutorial
/* * Copyright 2016 Shunyi Chen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dockingsoftware.dockingpreference; import org.dom4j.Element; public class NodeInfo { /** * Constructor. * * @param element */ public NodeInfo(Element element) { this.element = element; this.name = element.getName(); this.clazz = element.attributeValue(GlobalConstant.CLASS); this.adapter = element.attributeValue(GlobalConstant.ADAPTER); this.value = element.getText().trim();// field value this.arrayType = element.attributeValue(GlobalConstant.ARRAY_TYPE); this.arrayLength = element.attributeValue(GlobalConstant.ARRAY_LENGTH); } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClazz() { return clazz; } public void setClazz(String clazz) { this.clazz = clazz; } public String getAdapter() { return adapter; } public void setAdapter(String adapter) { this.adapter = adapter; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public Element getElement() { return element; } public void setElement(Element element) { this.element = element; } public String getArrayType() { return arrayType; } public void setArrayType(String arrayType) { this.arrayType = arrayType; } public String getArrayLength() { return arrayLength; } public void setArrayLength(String arrayLength) { this.arrayLength = arrayLength; } /** Field name */ private String name; /** Field class */ private String clazz; /** Adapter of field value */ private String adapter; /** Field value */ private String value; /** The element corresponding to the name field */ private Element element; /** Array type */ private String arrayType; /** Array length */ private String arrayLength; }