Community
Participate
Working Groups
Bundle-Localization: plugin
Export-Package: org.eclipse.jst.jsf.common;x-internal:=true,
org.eclipse.jst.jsf.common.dom,
org.eclipse.jst.jsf.common.internal;x-friends:="org.eclipse.jst.jsf.core",
org.eclipse.jst.jsf.common.internal.types;x-friends:="org.eclipse.jst.jsf.core,org.eclipse.jst.jsf.core.tests,org.eclipse.jst.jsf.validation.el.tests,org.eclipse.jst.jsf.designtime.tests,org.eclipse.jst.jsf.context.symbol.tests",
org.eclipse.jst.jsf.common.metadata,
org.eclipse.jst.jsf.common.metadata.internal;x-friends:="org.eclipse.jst.jsf.metadata.tests",
import java.util.Iterator;
import org.eclipse.jst.jsf.common.internal.JSPUtil;
import org.eclipse.jst.jsf.context.IModelContext;
import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
try
{
smodel = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)context.getStructuredDocument());
return "org.eclipse.jst.jsp.core.jspsource".equals(smodel.getContentTypeIdentifier()); //$NON-NLS-1$
return JSPUtil.isJSPContentType(smodel.getContentTypeIdentifier()); //$NON-NLS-1$
}
finally
package org.eclipse.jst.jsf.common.internal;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
/**
* Utility JSP methods
* @author cbateman
*
*/
public final class JSPUtil
private final static String CTYPE_JSPSOURCE =
"org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
private final static String CTYPE_JSPFRAGMENTSOURCE =
"org.eclipse.jst.jsp.core.jspfragmentsource"; //$NON-NLS-1$
* @param contentType
* @return true if contentType is one of the content types registered
* for JSP files
public static boolean isJSPContentType(final String contentType)
return CTYPE_JSPSOURCE.equals(contentType)
|| CTYPE_JSPFRAGMENTSOURCE.equals(contentType);
* @param file
* @return true if file is associated with a JSP or JSP fragment content type
public static boolean isJSPContentType(final IFile file)
final IContentTypeManager typeManager = Platform.getContentTypeManager();
IContentType jspContentType =
typeManager.getContentType(CTYPE_JSPSOURCE);
if (jspContentType != null
&& jspContentType.isAssociatedWith(file.getName()))
return true;
jspContentType =
typeManager.getContentType(CTYPE_JSPFRAGMENTSOURCE);
// otherwise check if fragment
return false;
private JSPUtil()
// no instantiation
super("/testdata/jsps/beanPropertyResolution.jsp.data", "/beanPropertyResolution.jsp", IJSFCoreConstants.FACET_VERSION_1_1,FACES_CONFIG_FILE_NAME_1_1);
* Allow sub-classing for sensitivity analysis (i.e. different dest file extensions)
* @param srcFile
* @param destFile
protected BeanPropertyResolutionTestCase(final String srcFile, final String destFile)
super(srcFile,destFile, IJSFCoreConstants.FACET_VERSION_1_1,FACES_CONFIG_FILE_NAME_1_1);
protected void setUp() throws Exception
super.setUp();
import org.eclipse.jst.jsf.validation.el.tests.jsp.PropertiesOfMapsTestCase;
import org.eclipse.jst.jsf.validation.el.tests.jsp.UnaryEmptyTestCase;
import org.eclipse.jst.jsf.validation.el.tests.jsp.UnaryMinusTestCase;
import org.eclipse.jst.jsf.validation.el.tests.jsp.ext.BeanPropertyResolutionTestCase_JSFExt;
import org.eclipse.jst.jsf.validation.el.tests.jsp.ext.BeanPropertyResolutionTestCase_JSPFExt;
import org.eclipse.jst.jsf.validation.el.tests.jsp.ext.BeanPropertyResolutionTestCase_JSPXExt;
public class CommonTests
suite.addTest(new ConfigurableTestSuite(UnaryMinusTestCase.class));
suite.addTest(new ConfigurableTestSuite(MarkerOffsetsTestCase.class));
// file extension sensitivity
suite.addTest(new ConfigurableTestSuite(BeanPropertyResolutionTestCase_JSFExt.class));
suite.addTest(new ConfigurableTestSuite(BeanPropertyResolutionTestCase_JSPXExt.class));
suite.addTest(new ConfigurableTestSuite(BeanPropertyResolutionTestCase_JSPFExt.class));
//$JUnit-END$
package org.eclipse.jst.jsf.validation.el.tests.jsp.ext;
import org.eclipse.jst.jsf.validation.el.tests.jsp.BeanPropertyResolutionTestCase;
* Test cases for bean property resolution
public class BeanPropertyResolutionTestCase_JSPXExt extends BeanPropertyResolutionTestCase
public BeanPropertyResolutionTestCase_JSPXExt() {
super("/testdata/jsps/beanPropertyResolution.jsp.data", "/beanPropertyResolution.jspx");
public class BeanPropertyResolutionTestCase_JSFExt extends BeanPropertyResolutionTestCase
public BeanPropertyResolutionTestCase_JSFExt() {
super("/testdata/jsps/beanPropertyResolution.jsp.data", "/beanPropertyResolution.jsf");
public class BeanPropertyResolutionTestCase_JSPFExt extends BeanPropertyResolutionTestCase
public BeanPropertyResolutionTestCase_JSPFExt() {
super("/testdata/jsps/beanPropertyResolution.jsp.data", "/beanPropertyResolution.jspf");
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
import org.eclipse.ui.IEditorInput;
if (file != null)
IContentTypeManager typeManager = Platform.getContentTypeManager();
return JSPUtil.isJSPContentType(file);
typeManager.getContentType("org.eclipse.jst.jsp.core.jspsource"); //$NON-NLS-1$
<validator>
<projectNature id="org.eclipse.wst.common.modulecore.ModuleCoreNature" />
<projectNature id="org.eclipse.jdt.core.javanature" />
<filter
objectClass="org.eclipse.core.resources.IFile"
nameFilter="*.jsp">
</filter>
nameFilter="*.jspx">
<markerId
markerIdValue="JSPSemanticsValidatorMarker">
</markerId>
incremental="true"
fullBuild="true"
/>
<contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.jspsource">
</contentTypeBinding>
contentTypeId="org.eclipse.jst.jsp.core.jspfragmentsource">
</validator>
</extension>