Java tutorial
/* * Copyright 2012 National Instruments Corporation * * 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.pieframework.model.resources; import java.util.ArrayList; import org.apache.commons.lang.builder.ReflectionToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.simpleframework.xml.Attribute; import org.simpleframework.xml.ElementList; import org.simpleframework.xml.Root; import com.pieframework.model.system.Property; @Root(strict = false) public class Resource { @Attribute private String id; @ElementList(name = "props", inline = true, required = false) private ArrayList<Property> list; public String getId() { return id; } public void setId(String id) { this.id = id; } public ArrayList<Property> getList() { return list; } public void setList(ArrayList<Property> list) { this.list = list; } @Override public String toString() { // TODO Auto-generated method stub ReflectionToStringBuilder.setDefaultStyle(ToStringStyle.MULTI_LINE_STYLE); return ReflectionToStringBuilder.toString(this); } }