Skip to main content
summaryrefslogtreecommitdiffstats
blob: 39ffa312dbfaffc6917a7012175d6911aedade07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*******************************************************************************
 * Copyright (c) 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 * yyyymmdd bug      Email and other contact information
 * -------- -------- -----------------------------------------------------------
 * 20060419   132905 cbrealey@ca.ibm.com - Chris Brealey          
 *******************************************************************************/
package org.eclipse.jst.ws.internal.conformance;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;

/**
 * A basic default implementation of IJavaWebServiceRule.
 */
public class JavaWebServiceRule implements IJavaWebServiceRule
{
	protected IJavaWebServiceRuleEngine engine_;
	protected List statusList_;
	protected int id_;
	protected String namespace_;
	protected String name_;
	protected String description_;
	
	protected JavaWebServiceRule ()
	{
		// Not publicly constructable.
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#getId()
	 */
	public int getId ()
	{
		return id_;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#getNamespace()
	 */
	public String getNamespace ()
	{
		return namespace_;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#getName()
	 */
	public String getName ()
	{
		return name_;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#getDescription()
	 */
	public String getDescription ()
	{
		return description_;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#init()
	 */
	public void init ( IJavaWebServiceRuleEngine engine )
	{
		engine_ = engine;
		statusList_ = new LinkedList();
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#visitClass(org.eclipse.jdt.core.IType, java.util.Stack)
	 */
	public void visitClass ( IType jdtClass, Stack peanutTrail )
	{
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#visitException(org.eclipse.jdt.core.IField, java.util.Stack)
	 */
	public void visitException ( IType jdtClass, Stack peanutTrail )
	{
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#visitField(org.eclipse.jdt.core.IField, java.util.Stack)
	 */
	public void visitField ( IField jdtField, Stack peanutTrail )
	{
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#visitProperty(org.eclipse.jdt.core.IMethod, org.eclipse.jdt.core.IMethod, java.util.Stack)
	 */
	public void visitProperty ( IJavaBeanProperty beanProperty, Stack peanutTrail )
	{
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#visitMethod(org.eclipse.jdt.core.IMethod, java.util.Stack)
	 */
	public void visitMethod ( IMethod jdtMethod, Stack peanutTrail )
	{
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jst.ws.internal.conformance.IJavaWebServiceRule#getResults()
	 */
	public IStatus getResults ()
	{
		IStatus status = null;
		if (statusList_.size() == 0)
		{
			status = new Status(IStatus.OK,"org.eclipse.jst.ws",0,"",null);
		}
		else
		{
			MultiStatus multiStatus = new MultiStatus("org.eclipse.jst.ws",0,"",null);
			Iterator i = statusList_.iterator();
			while (i.hasNext())
			{
				multiStatus.add((IStatus)i.next());
			}
			status = multiStatus;
		}
		return status;
	}
}

Back to the top