Author: dgolovin
Date: 2011-08-25 14:33:07 -0400 (Thu, 25 Aug 2011)
New Revision: 34320
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationELReference.java
Log:
instead of using getter as a template method, initialize property value in constructor
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2011-08-25
18:20:38 UTC (rev 34319)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2011-08-25
18:33:07 UTC (rev 34320)
@@ -36,7 +36,7 @@
* Represents a reference to EL in a resource
* @author Alexey Kazakov
*/
-public abstract class ELReference implements ITextSourceReference {
+public class ELReference implements ITextSourceReference {
private IFile resource;
private IPath path;
@@ -49,7 +49,16 @@
private boolean needToInitMarkers = false;
private List<SyntaxError> syntaxErrors;
private String source;
-
+ private String elMarkerGroupID;
+
+ public ELReference() {
+
+ }
+
+ public ELReference(String elMarkerGroupID) {
+ this.elMarkerGroupID = elMarkerGroupID;
+ }
+
/**
* @return
*/
@@ -206,7 +215,7 @@
}
for(int i=0; i<markers.length; i++){
String groupName = markers[i].getAttribute("groupName", null);
//$NON-NLS-1$
- if(groupName!=null && (groupName.equals(getMarkerGroupId()))) {
+ if(groupName!=null && (groupName.equals(this.elMarkerGroupID))) {
int start = markers[i].getAttribute(IMarker.CHAR_START, -1);
int end = markers[i].getAttribute(IMarker.CHAR_END, -1);
if(start>=startPosition && end<=startPosition+length) {
@@ -234,7 +243,9 @@
this.syntaxErrors = syntaxErrors;
}
- protected abstract String getMarkerGroupId();
+ public String getMarkerGroupId() {
+ return this.elMarkerGroupID;
+ }
/**
* @param needToInitMarkers the needToInitMarkers to set
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationELReference.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationELReference.java 2011-08-25
18:20:38 UTC (rev 34319)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationELReference.java 2011-08-25
18:33:07 UTC (rev 34320)
@@ -17,11 +17,7 @@
*/
public class ValidationELReference extends ELReference {
- /* (non-Javadoc)
- * @see org.jboss.tools.common.el.core.ELReference#getMarkerGroupId()
- */
- @Override
- protected String getMarkerGroupId() {
- return IValidator.MARKED_RESOURCE_MESSAGE_GROUP;
+ public ValidationELReference() {
+ super(IValidator.MARKED_RESOURCE_MESSAGE_GROUP);
}
}
\ No newline at end of file
Show replies by date