[jbosstools-commits] JBoss Tools SVN: r17535 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Sep 11 20:20:18 EDT 2009


Author: akazakov
Date: 2009-09-11 20:20:17 -0400 (Fri, 11 Sep 2009)
New Revision: 17535

Added:
   trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java
   trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java
   trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4860 Added new interfaces for new EL resolvers.

Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java	2009-09-12 00:20:17 UTC (rev 17535)
@@ -0,0 +1,62 @@
+/******************************************************************************* 
+ * Copyright (c) 2009 Red Hat, Inc. 
+ * Distributed under license by Red Hat, Inc. All rights reserved. 
+ * This program is 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: 
+ * Red Hat, Inc. - initial API and implementation 
+ ******************************************************************************/ 
+package org.jboss.tools.common.el.core.resolver;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.jboss.tools.common.el.core.model.ELExpression;
+
+/**
+ * Describes a result of EL resolving action.
+ * @author Alexey Kazakov
+ */
+public interface ELResolution {
+
+	/**
+	 * @return all segments of this EL operand.
+	 */
+	List<ELSegment> getSegments();
+
+	/**
+	 * @return source EL operand.
+	 */
+	ELExpression getSourceOperand();
+
+	/**
+	 * @return EL context.
+	 */
+	ELContext getContext();
+
+	/**
+	 * Finds the segment which is resolved to given java element.
+	 * @param element
+	 * @return
+	 */
+	ELSegment findSegmentByJavaElement(IJavaElement element);
+
+	/**
+	 * Finds the segment which is located at given offset.
+	 * @param offcet relative source EL operand.
+	 * @return
+	 */
+	ELSegment findSegmentByOffset(int offcet);
+
+	/**
+	 * @return unresolved segment. May return null.
+	 */
+	ELSegment getUnresolvedSegment();
+
+	/**
+	 * @return true if there is any unresolved segment.
+	 */
+	boolean hasUnresolvedSegment();
+}
\ No newline at end of file


Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolution.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java	2009-09-12 00:20:17 UTC (rev 17535)
@@ -0,0 +1,39 @@
+/******************************************************************************* 
+ * Copyright (c) 2009 Red Hat, Inc. 
+ * Distributed under license by Red Hat, Inc. All rights reserved. 
+ * This program is 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: 
+ * Red Hat, Inc. - initial API and implementation 
+ ******************************************************************************/ 
+package org.jboss.tools.common.el.core.resolver;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.text.TextProposal;
+
+/**
+ * Represents EL Resolver.
+ * TODO replace old ELResolver interface with this one.
+ * @author Alexey Kazakov
+ */
+public interface ELResolver2 {
+
+	/**
+	 * @param context
+	 * @param el
+	 * @return proposal list
+	 */
+	List<TextProposal> getProposals(ELContext context, String el);
+
+	/**
+	 * Resolves EL operand.
+	 * @param context
+	 * @param operand
+	 * @return
+	 */
+	ELResolution resolve(ELContext context, ELExpression operand);
+}
\ No newline at end of file


Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolver2.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java	2009-09-12 00:20:17 UTC (rev 17535)
@@ -0,0 +1,41 @@
+/******************************************************************************* 
+ * Copyright (c) 2009 Red Hat, Inc. 
+ * Distributed under license by Red Hat, Inc. All rights reserved. 
+ * This program is 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: 
+ * Red Hat, Inc. - initial API and implementation 
+ ******************************************************************************/ 
+package org.jboss.tools.common.el.core.resolver;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+
+/**
+ * Describes a segment of EL operand.
+ * @author Alexey Kazakov
+ */
+public interface ELSegment {
+
+	/**
+	 * @return source EL token.
+	 */
+	ELInvocationExpression getToken();
+
+	/**
+	 * @return member info object of resolved segment. May return null.
+	 */
+	TypeInfoCollector.MemberInfo getMemberInfo();
+
+	/**
+	 * @return Java Element which represent this resolve segment. May return null. 
+	 */
+	IJavaElement getJavaElement();
+
+	/**
+	 * @return true if the segment has been resolved.
+	 */
+	boolean isResolved();
+}
\ No newline at end of file


Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegment.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list