001 002/* 003 * Copyright (C) 2010 Archie L. Cobbs. All rights reserved. 004 * 005 * $Id$ 006 */ 007 008package org.dellroad.jibxbindings.pidf.held; 009 010import java.util.ArrayList; 011import java.util.List; 012 013import org.dellroad.jibxbindings.pidf.LangContent; 014 015/** 016 * The {@code <held:error>} XML element. 017 */ 018public class Error implements Cloneable { 019 020 public static final String REQUEST_ERROR = "requestError"; 021 public static final String XML_ERROR = "xmlError"; 022 public static final String GENERAL_LIS_ERROR = "generalLisError"; 023 public static final String LOCATION_UNKNOWN = "locationUnknown"; 024 public static final String UNSUPPORTED_MESSAGE = "unsupportedMessage"; 025 public static final String TIMEOUT = "timeout"; 026 public static final String CANNOT_PROVIDE_LI_TYPE = "cannotProvideLiType"; 027 public static final String NOT_LOCATABLE = "notLocatable"; 028 029 private String code; 030 private List<LangContent> messages = new ArrayList<LangContent>(); 031 032 public String getCode() { 033 return this.code; 034 } 035 public void setCode(String code) { 036 this.code = code; 037 } 038 039 public List<LangContent> getMessages() { 040 return this.messages; 041 } 042 public void setMessage(List<LangContent> messages) { 043 this.messages = messages; 044 } 045 046// Cloneable 047 048 @Override 049 public Error clone() { 050 final Error clone; 051 try { 052 clone = (Error)super.clone(); 053 } catch (CloneNotSupportedException e) { 054 throw new RuntimeException(e); 055 } 056 if (clone.messages != null) { 057 clone.messages = new ArrayList<>(this.messages.size()); 058 for (LangContent message : this.messages) 059 clone.messages.add(message.clone()); 060 } 061 return clone; 062 } 063} 064