Author: scabanovich
Date: 2011-04-07 19:35:21 -0400 (Thu, 07 Apr 2011)
New Revision: 30430
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXText.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/ConfigFileSet.java
Log:
JBIDE-3120
https://issues.jboss.org/browse/JBIDE-3120
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-04-07
22:22:30 UTC (rev 30429)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -11,15 +11,22 @@
package org.jboss.tools.cdi.seam.config.core;
+import java.util.Set;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.extension.ICDIExtension;
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
import org.jboss.tools.cdi.seam.config.core.scanner.ConfigFileSet;
+import org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
/**
@@ -70,6 +77,27 @@
}
public void buildDefinitions() {
+ Set<IPath> paths = fileSet.getAllPaths();
+ for (IPath p: paths) {
+ boolean isSeamBeans = false;
+ XModelObject o = fileSet.getBeanXML(p);
+ if(o == null) {
+ o = fileSet.getSeamBeanXML(p);
+ isSeamBeans = true;
+ }
+ if(o instanceof FileAnyImpl) {
+ String text = ((FileAnyImpl)o).getAsText();
+ IDocument document = new Document();
+ SeamDefinitionBuilder builder = new SeamDefinitionBuilder();
+ document.set(text);
+ SeamBeansDefinition def = builder.createDefinition(document, project);
+ if(isSeamBeans) {
+ context.addSeamBeanXML(p, def);
+ } else {
+ context.addBeanXML(p, def);
+ }
+ }
+ }
//TODO
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/ConfigFileSet.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/ConfigFileSet.java 2011-04-07
22:22:30 UTC (rev 30429)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/ConfigFileSet.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core.scanner;
import java.util.HashMap;
@@ -5,13 +15,14 @@
import java.util.Map;
import java.util.Set;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IPackageDeclaration;
-import org.eclipse.jdt.core.IType;
import org.jboss.tools.common.model.XModelObject;
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
public class ConfigFileSet {
private Set<IPath> allpaths = new HashSet<IPath>();
private Map<IPath, XModelObject> beanXMLs = new HashMap<IPath,
XModelObject>();
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core.scanner;
+
+import org.jboss.tools.common.text.ITextSourceReference;
+
+public class Location implements ITextSourceReference {
+ int start;
+ int length;
+
+ public Location(int start, int length) {
+ this.start = start;
+ this.length = length;
+ }
+
+ public int getStartPosition() {
+ return start;
+ }
+
+ public int getLength() {
+ return length;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core.scanner;
+
+import org.jboss.tools.common.text.ITextSourceReference;
+
+public class SAXAttribute extends SAXNode {
+ private String name;
+ private ITextSourceReference nameLocation;
+ private String value;
+ private ITextSourceReference valueLocation;
+
+ private SAXElement parent;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setNameLocation(ITextSourceReference location) {
+ nameLocation = location;
+ }
+
+ public void setValueLocation(ITextSourceReference location) {
+ valueLocation = location;
+ }
+
+ public ITextSourceReference getNameLocation() {
+ return nameLocation;
+ }
+
+ public ITextSourceReference getValueLocation() {
+ return valueLocation;
+ }
+
+ public void setParent(SAXElement parent) {
+ this.parent = parent;
+ }
+
+ public SAXElement getParent() {
+ return parent;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core.scanner;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.common.text.ITextSourceReference;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SAXElement extends SAXNode {
+ protected String uri;
+ protected String localName;
+ protected String name;
+ protected ITextSourceReference nameLocation;
+ protected Map<String, SAXAttribute> attributes = new HashMap<String,
SAXAttribute>();
+ protected SAXText text;
+
+ protected SAXElement parent = null;
+ protected List<SAXElement> children = new ArrayList<SAXElement>();
+
+ public SAXElement() {}
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setNameLocation(ITextSourceReference location) {
+ nameLocation = location;
+ }
+
+ public ITextSourceReference getNameLocation() {
+ return nameLocation;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setLocalName(String name) {
+ localName = name;
+ }
+
+ public String getLocalName() {
+ return localName;
+ }
+
+ public void setTextNode(SAXText text) {
+ this.text = text;
+ }
+
+ public SAXText getTextNode() {
+ return text;
+ }
+
+ public void addAttribute(SAXAttribute a) {
+ a.setParent(this);
+ attributes.put(a.getName(), a);
+ }
+
+ public boolean hasAttribute(String name) {
+ return attributes.containsKey(name);
+ }
+
+ public SAXAttribute getAttribute(String name) {
+ return attributes.get(name);
+ }
+
+ public void addChildElement(SAXElement child) {
+ child.setParent(this);
+ children.add(child);
+ }
+
+ public List<SAXElement> getChildElements() {
+ return children;
+ }
+
+ public void setParent(SAXElement parent) {
+ this.parent = parent;
+ }
+
+ public SAXElement getParent() {
+ return parent;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core.scanner;
+
+import org.jboss.tools.common.text.ITextSourceReference;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SAXNode {
+ protected ITextSourceReference location = null;
+
+ public void setLocation(ITextSourceReference location) {
+ this.location = location;
+ }
+
+ public ITextSourceReference getLocation() {
+ return location;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,180 @@
+package org.jboss.tools.cdi.seam.config.core.scanner;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.common.xml.SAXValidator;
+import org.jboss.tools.common.xml.XMLEntityResolverImpl;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class SAXParser extends SAXValidator {
+
+ XMLReader createParser1(DefaultHandler handler) {
+ XMLReader parserInstance = null;
+
+ try {
+ parserInstance = XMLReaderFactory.createXMLReader(DEFAULT_SAX_PARSER_CLASS_NAME);
+ } catch (SAXException e) {
+ return null;
+ }
+
+ setFeature(parserInstance, NAMESPACES_FEATURE_ID, true);
+ setFeature(parserInstance, NAMESPACE_PREFIXES_FEATURE_ID, false);
+ setFeature(parserInstance, VALIDATION_FEATURE_ID, true);
+ setFeature(parserInstance, VALIDATION_SCHEMA_FEATURE_ID, true);
+ setFeature(parserInstance, VALIDATION_SCHEMA_CHECKING_FEATURE_ID, false);
+ setFeature(parserInstance, VALIDATION_DYNAMIC_FEATURE_ID, false);
+ setFeature(parserInstance, FATAL_ERROR_PROCESSING_FEATURE_ID, false);
+
+ try {
+ parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
+ } catch (SAXNotRecognizedException e1) {
+ CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1);
//$NON-NLS-1$
+ } catch (SAXNotSupportedException e1) {
+ CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1);
//$NON-NLS-1$
+ }
+
+ parserInstance.setContentHandler(handler);
+ parserInstance.setErrorHandler(handler);
+ return parserInstance;
+ }
+
+ public SAXElement parse(InputStream input, IDocument document) {
+ InputSource s = new InputSource(input);
+ ConfigHanlder handler = new ConfigHanlder(document);
+ XMLReader reader = createParser1(handler);
+ try {
+ reader.parse(s);
+ } catch (IOException e) {
+ CommonPlugin.getDefault().logError(e);
+ } catch (SAXException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+
+ return handler.getRootElement();
+ }
+
+ class ConfigHanlder extends DefaultHandler {
+ SAXElement root = null;
+ IDocument document;
+ Locator locator;
+ List<String> errors = new ArrayList<String>();
+ SAXElement current = null;
+
+ StringBuffer currentText = new StringBuffer();
+ ITextSourceReference currentTextLocation = null;
+
+ ConfigHanlder(IDocument document) {
+ this.document = document;
+ }
+
+ public SAXElement getRootElement() {
+ return root;
+ }
+
+ public void setDocumentLocator (Locator locator) {
+ this.locator = locator;
+ }
+
+ private int getCurrentLocation() {
+ if (locator != null) {
+ int line = locator.getLineNumber() - 1;
+ int lineOffset = locator.getColumnNumber() - 1;
+ try {
+ return document.getLineOffset(line) + lineOffset;
+ } catch (BadLocationException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ }
+ return 0;
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes
attributes) throws SAXException {
+ int end = getCurrentLocation(), start = 0;
+ if(end > 0) {
+ start = document.get().lastIndexOf("<", end);
+ }
+ SAXElement element = new SAXElement();
+ element.setLocalName(localName);
+ element.setURI(uri);
+ element.setName(qName);
+ element.setParent(current);
+ if(start >= 0) {
+ element.setLocation(new Location(start, end - start));
+ int ns = document.get().indexOf(qName, start);
+ if(ns >= start) {
+ element.setNameLocation(new Location(ns, qName.length()));
+ }
+ }
+ for (int i = 0; i < attributes.getLength(); i++) {
+ String n = attributes.getLocalName(i);
+ String v = attributes.getValue(i);
+ SAXAttribute a = new SAXAttribute();
+ a.setName(n);
+ a.setValue(v);
+ //TODO
+ element.addAttribute(a);
+ }
+
+ current = element;
+ currentText = new StringBuffer();
+ currentTextLocation = null;
+ }
+
+ public void characters (char ch[], int start, int length) throws SAXException {
+ String append = new String(ch, start, length);
+ if(append.trim().length() == 0) return;
+ int end = getCurrentLocation(), s = 0;
+ if (end > 0) {
+ s = end - length;
+ }
+ currentText.append(append);
+ currentTextLocation = new Location(s, length);
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException
{
+ int end = getCurrentLocation();
+ if(end > 0) {
+ int start = document.get().lastIndexOf("<", end);
+ ITextSourceReference endLocation = new Location(start, end - start);
+ //TODO
+ }
+ if(currentText.length() > 0) {
+ SAXText text = new SAXText();
+ text.setValue(currentText.toString());
+ current.setTextNode(text);
+ text.setLocation(currentTextLocation);
+ }
+
+ current = current.getParent();
+ }
+
+
+ public void error(SAXParseException e) throws SAXException {
+ String message = e.getException().getMessage();
+ errors.add(message);
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ String message = e.getMessage();
+ errors.add(message);
+ }
+ }
+
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXText.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXText.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXText.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.seam.config.core.scanner;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SAXText extends SAXNode {
+ private String value;
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXText.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-04-07
23:35:21 UTC (rev 30430)
@@ -0,0 +1,21 @@
+package org.jboss.tools.cdi.seam.config.core.scanner;
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.jface.text.IDocument;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
+
+public class SeamDefinitionBuilder {
+
+ public SeamBeansDefinition createDefinition(IDocument document, CDICoreNature project)
{
+ SAXParser parser = new SAXParser();
+ String text = document.get();
+ ByteArrayInputStream s = new ByteArrayInputStream(text.getBytes());
+ SAXElement element = parser.parse(s, document);
+ SeamBeansDefinition result = new SeamBeansDefinition();
+ //TODO
+ return result;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain