001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php 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 */ 016package org.kuali.rice.kew.api.action; 017 018import java.util.Collection; 019 020import javax.xml.bind.annotation.XmlAccessType; 021import javax.xml.bind.annotation.XmlAccessorType; 022import javax.xml.bind.annotation.XmlAnyElement; 023import javax.xml.bind.annotation.XmlElement; 024import javax.xml.bind.annotation.XmlRootElement; 025import javax.xml.bind.annotation.XmlType; 026 027import org.apache.commons.lang.StringUtils; 028import org.kuali.rice.core.api.CoreConstants; 029import org.kuali.rice.core.api.mo.AbstractDataTransferObject; 030import org.w3c.dom.Element; 031 032@XmlRootElement(name = ReturnPoint.Constants.ROOT_ELEMENT_NAME) 033@XmlAccessorType(XmlAccessType.NONE) 034@XmlType(name = ReturnPoint.Constants.TYPE_NAME, propOrder = { 035 ReturnPoint.Elements.NODE_NAME, 036 CoreConstants.CommonElements.FUTURE_ELEMENTS 037}) 038public final class ReturnPoint extends AbstractDataTransferObject { 039 040 @XmlElement(name = Elements.NODE_NAME, required = true) 041 private final String nodeName; 042 043 @SuppressWarnings("unused") 044 @XmlAnyElement 045 private final Collection<Element> _futureElements = null; 046 047 private ReturnPoint() { 048 this.nodeName = null; 049 } 050 051 private ReturnPoint(String nodeName) { 052 if (nodeName == null) { 053 throw new IllegalArgumentException("nodeName was null"); 054 } 055 this.nodeName = nodeName; 056 } 057 058 public static ReturnPoint create(String nodeName) { 059 return new ReturnPoint(nodeName); 060 } 061 062 public String getNodeName() { 063 return nodeName; 064 } 065 066 /** 067 * Defines some internal constants used on this class. 068 */ 069 static class Constants { 070 final static String ROOT_ELEMENT_NAME = "returnPoint"; 071 final static String TYPE_NAME = "ReturnPointType"; 072 } 073 074 /** 075 * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML. 076 */ 077 static class Elements { 078 final static String NODE_NAME = "nodeName"; 079 } 080 081}