Author: dgolovin
Date: 2008-01-03 20:54:38 -0500 (Thu, 03 Jan 2008)
New Revision: 5495
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDinamicResource.java
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDtdStore.java
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbHtmlMap.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1544
Need add @catalogProperty@@schemaProperty@ back to persistence.xml templates file in
seam-gen.
JUnit tests also added.
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDinamicResource.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDinamicResource.java 2008-01-03
17:47:02 UTC (rev 5494)
+++
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDinamicResource.java 2008-01-04
01:54:38 UTC (rev 5495)
@@ -19,19 +19,19 @@
*/
public interface KbDinamicResource extends KbResource {
- public static final String BUNDLE_PROPERTY_TYPE = "bundleProperty";
- public static final String BEAN_PROPERTY_TYPE = "beanProperty";
- public static final String BEAN_METHOD_BY_SYGNATURE_TYPE =
"beanMethodBySignature";
- public static final String JSP_PATH_TYPE = "jspPath";
- public static final String BUNDLE_NAME_TYPE = "bundleName";
- public static final String VIEW_ACTIONS_TYPE = "viewActions";
- public static final String IMAGE_FILE_TYPE = "file";
- public static final String ENUMERATION_TYPE = "enumeration";
- public static final String JSF_VARIABLES_TYPE = "jsfVariables";
- public static final String FACELETS_JSFC_TYPE = "faceletsJsfCTags";
- public static final String MANAGED_BEAN_NAME_TYPE = "managedBeanName";
- public static final String JSF_ID = "jsfID";
- public static final String TAGLIB_TYPE = "taglib";
+ String BUNDLE_PROPERTY_TYPE = "bundleProperty";
+ String BEAN_PROPERTY_TYPE = "beanProperty";
+ String BEAN_METHOD_BY_SYGNATURE_TYPE = "beanMethodBySignature";
+ String JSP_PATH_TYPE = "jspPath";
+ String BUNDLE_NAME_TYPE = "bundleName";
+ String VIEW_ACTIONS_TYPE = "viewActions";
+ String IMAGE_FILE_TYPE = "file";
+ String ENUMERATION_TYPE = "enumeration";
+ String JSF_VARIABLES_TYPE = "jsfVariables";
+ String FACELETS_JSFC_TYPE = "faceletsJsfCTags";
+ String MANAGED_BEAN_NAME_TYPE = "managedBeanName";
+ String JSF_ID = "jsfID";
+ String TAGLIB_TYPE = "taglib";
/**
* Sets a parameter for resource.
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDtdStore.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDtdStore.java 2008-01-03
17:47:02 UTC (rev 5494)
+++
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbDtdStore.java 2008-01-04
01:54:38 UTC (rev 5495)
@@ -21,18 +21,18 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.StringTokenizer;
import java.util.Vector;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
+import org.jboss.tools.common.kb.configuration.KbConfigurationFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.jboss.tools.common.kb.configuration.KbConfigurationFactory;
-
/**
* @author eskimo
*/
@@ -41,9 +41,9 @@
public static final String XML_DECLARATION = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>";
private String schemaLocation;
- private Vector<Document> activeDocuments;
- private Vector<KbDtdResource> registratedResources;
- private Vector<KbDtdResource> downloadingResources;
+ private List<Document> activeDocuments;
+ private List<KbDtdResource> registratedResources;
+ private List<KbDtdResource> downloadingResources;
private static final KbDtdStore INSTANCE = new KbDtdStore();
@@ -83,7 +83,7 @@
}
InerDtdQuery inerDtdQuery = getInerDtdQery(new KbQuery(queryForLastTag,
query.getResources()));
- ArrayList elementTypes = inerDtdQuery.getElementTypes();
+ List elementTypes = inerDtdQuery.getElementTypes();
return KbSchemaUtil.getTagInformationFromElementTypes(elementTypes, lastTag, new
HashSet());
}
@@ -115,7 +115,7 @@
return proposals;
}
- ArrayList<KbProposal> proposals = queryTagProposal(getInerDtdQery(query));
+ List<KbProposal> proposals = queryTagProposal(getInerDtdQery(query));
KbProposal endTag = getEndTagProposal(query);
if(endTag != null) {
proposals.add(endTag);
@@ -141,7 +141,7 @@
throw new IllegalArgumentException("Bad query: " + strQuery + ". Query
must starts with \"" + KbQuery.TAG_SEPARATOR + "\" or \"" +
KbQuery.XML_DECLARATION_QUERY + "\"");
}
- ArrayList<Element> elementTypes = new ArrayList<Element>();
+ List<Element> elementTypes = new ArrayList<Element>();
String tagQuery = null;
int lastTagSeparator = strQuery.lastIndexOf(KbQuery.TAG_SEPARATOR);
if(lastTagSeparator > firstTagSeparator) {
@@ -325,7 +325,7 @@
}
}
- private ArrayList<Element> getChildElementTypes(Collection resources,
StringTokenizer tagNames) {
+ private List<Element> getChildElementTypes(Collection resources, StringTokenizer
tagNames) {
// KbPlugin.log("--> getChildElementTypes(Collection resources, StringTokenizer
tagNames)");
// KbPlugin.log(" resources size = " + resources.size());
// KbPlugin.log(" tagNames = " + tagNames);
@@ -333,7 +333,7 @@
String tagName = tagNames.nextToken();
// KbPlugin.log(" tagName = " + tagName);
- ArrayList<Element> childElements = getChildElements(resources, tagName, true);
+ List<Element> childElements = getChildElements(resources, tagName, true);
// KbPlugin.log(" childElements size = " + childElements.size());
@@ -405,7 +405,7 @@
return null;
}
- private ArrayList<Element> addCollection(Collection<Element> col1,
Collection<Element> col2) {
+ private List<Element> addCollection(Collection<Element> col1,
Collection<Element> col2) {
ArrayList<Element> arrayList = new ArrayList<Element>();
Iterator<Element> iterator = col1.iterator();
while(iterator.hasNext()) {
@@ -418,7 +418,7 @@
return arrayList;
}
- private ArrayList<Element> getChildElements(Collection resources, String
elementTypeName, boolean rootTag) {
+ private List<Element> getChildElements(Collection resources, String
elementTypeName, boolean rootTag) {
// KbPlugin.log("--> getChildElements(Collection resources, String
elementTypeName, boolean rootTag)");
// KbPlugin.log(" resources size = " + resources.size());
// KbPlugin.log(" elementTypeName = " + elementTypeName);
@@ -473,11 +473,11 @@
return elements;
}
- private ArrayList<KbProposal> queryTagProposal(InerDtdQuery query) {
+ private List<KbProposal> queryTagProposal(InerDtdQuery query) {
return queryTagProposal(query.getElementTypes(), query.getTagQuery());
}
- private ArrayList<KbProposal> queryTagProposal(ArrayList elementTypes, String
query) {
+ private List<KbProposal> queryTagProposal(List elementTypes, String query) {
// KbPlugin.log("--> queryTagProposal(ArrayList elementTypes, String
query)");
// KbPlugin.log(" Query = " + query);
// KbPlugin.log(" elementTypes size = " + elementTypes.size());
@@ -722,7 +722,7 @@
}
}
- private ArrayList<KbProposal> getTags(Collection elementTypes, String tagMask) {
+ private List<KbProposal> getTags(Collection elementTypes, String tagMask) {
// KbPlugin.log("--> getTags(Collection elementTypes, String tagMask)");
// KbPlugin.log(" elementTypes size = " + elementTypes.size());
// KbPlugin.log(" tagMask = " + tagMask);
@@ -730,7 +730,7 @@
return getTagProposal(getElementTypesByName(elementTypes, tagMask, true));
}
- private ArrayList<Element> getElementTypesByName(Collection elementTypes, String
name, boolean mask) {
+ private List<Element> getElementTypesByName(Collection elementTypes, String name,
boolean mask) {
// KbPlugin.log("--> getElementTypesByName(Collection elementTypes, String name,
boolean mask)");
// KbPlugin.log(" elementTypes size = " + elementTypes.size());
// KbPlugin.log(" name = " + name);
@@ -755,7 +755,7 @@
return elements;
}
- private ArrayList<KbProposal> getAttributes(Collection elementTypes, String
tagName, String attributeMask) {
+ private List<KbProposal> getAttributes(Collection elementTypes, String tagName,
String attributeMask) {
// KbPlugin.log("--> getAttributes(String prefix, String tagName, String
attributeMask)");
// KbPlugin.log(" prefix = " + prefix);
// KbPlugin.log(" tagName = " + tagName);
@@ -764,10 +764,10 @@
return getAttributeProposal(getAttributeTypesByName(elementTypes, tagName,
attributeMask, true));
}
- private ArrayList<Element> getAttributeTypesByName(Collection elementTypes, String
tagName, String attributeName, boolean mask) {
- ArrayList<Element> attributes = new ArrayList<Element>();
+ private List<Element> getAttributeTypesByName(Collection elementTypes, String
tagName, String attributeName, boolean mask) {
+ List<Element> attributes = new ArrayList<Element>();
- ArrayList elements = getElementTypesByName(elementTypes, tagName, false);
+ List elements = getElementTypesByName(elementTypes, tagName, false);
if(!elements.isEmpty()) {
Element element = (Element)elements.get(0);
@@ -785,10 +785,10 @@
return attributes;
}
- private ArrayList<KbProposal> getEnumeration(Collection elementTypes, String
tagName, String attributeName, String valueMask) {
- ArrayList<KbProposal> enumeration = new ArrayList<KbProposal>();
+ private List<KbProposal> getEnumeration(Collection elementTypes, String tagName,
String attributeName, String valueMask) {
+ List<KbProposal> enumeration = new ArrayList<KbProposal>();
- ArrayList attributeTypes = new ArrayList();
+ List attributeTypes = new ArrayList();
attributeTypes = getAttributeTypesByName(elementTypes, tagName, attributeName, false);
if(!attributeTypes.isEmpty()) {
Element attributeType = (Element)attributeTypes.get(0);
@@ -814,15 +814,15 @@
return enumeration;
}
- private ArrayList<KbProposal> getTagProposal(ArrayList<Element> elements) {
+ private List<KbProposal> getTagProposal(List<Element> elements) {
return getProposal(elements, true);
}
- private ArrayList<KbProposal> getAttributeProposal(ArrayList elements) {
+ private List<KbProposal> getAttributeProposal(List elements) {
return getProposal(elements, false);
}
- private ArrayList<KbProposal> getProposal(ArrayList elements, boolean tag) {
+ private List<KbProposal> getProposal(List elements, boolean tag) {
// KbPlugin.log("--> getProposal(ArrayList elements, boolean tag)");
// KbPlugin.log(" elemnets size = " + elements.size());
// KbPlugin.log(" tag = " + tag);
@@ -959,10 +959,10 @@
private class InerDtdQuery {
- private ArrayList elementTypes;
+ private List elementTypes;
private String tagQuery;
- public InerDtdQuery(ArrayList elementTypes, String tagQuery) {
+ public InerDtdQuery(List elementTypes, String tagQuery) {
this.elementTypes = elementTypes;
this.tagQuery = tagQuery;
}
@@ -970,7 +970,7 @@
/**
* @return
*/
- public ArrayList getElementTypes() {
+ public List getElementTypes() {
return elementTypes;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbHtmlMap.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbHtmlMap.java 2008-01-03
17:47:02 UTC (rev 5494)
+++
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbHtmlMap.java 2008-01-04
01:54:38 UTC (rev 5495)
@@ -22,6 +22,8 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Properties;
import org.apache.xml.serialize.OutputFormat;
@@ -39,13 +41,13 @@
public class KbHtmlMap {
private final static String ROOT_ELEMENT_ATTRIBUTE_VALUE = "HTML";
- private HashMap htmlMap;
+ private Map htmlMap;
private static File hashMapLocation = new
File(KbConfigurationFactory.getInstance().getDefaultConfiguration().getHtmlMapFilePath());
/**
*
*/
- private KbHtmlMap(HashMap proposals) {
+ private KbHtmlMap(Map proposals) {
htmlMap = proposals;
}
@@ -56,7 +58,7 @@
HashMap<String,Element> children = new HashMap<String,Element>();
Element elementType = (Element)nodeList.item(i);
String tagName = elementType.getAttribute(SchemaNodeFactory.NAME_ATTRIBUTE);
- ArrayList childrenElementTypes = getChildElementTypes(schema, tagName);
+ List childrenElementTypes = getChildElementTypes(schema, tagName);
addOptionalTags(children, elementType);
for(int j=0; j<childrenElementTypes.size(); j++) {
Element childrenElementType = (Element)childrenElementTypes.get(j);
@@ -80,7 +82,7 @@
HashMap<String,Element> children = new HashMap<String,Element>();
Element elementType = (Element)nodeList.item(i);
String tagName = elementType.getAttribute(SchemaNodeFactory.NAME_ATTRIBUTE);
- ArrayList childrenElementTypes = getChildElementTypes(schema, tagName);
+ List childrenElementTypes = getChildElementTypes(schema, tagName);
addOptionalTags(children, elementType);
for(int j=0; j<childrenElementTypes.size(); j++) {
Element childrenElementType = (Element)childrenElementTypes.get(j);
@@ -158,7 +160,7 @@
String startTagType =
elementType.getAttribute(SchemaNodeFactory.START_TAG_ATTRIBUTE);
if(SchemaNodeFactory.OPTIONAL_TAG_TYPE.equals(startTagType)) {
// KbPlugin.log(" Tag have optional start tag");
- ArrayList childElementTypes = getChildElementTypes(elementType.getOwnerDocument(),
elementType.getAttribute(SchemaNodeFactory.NAME_ATTRIBUTE));
+ List childElementTypes = getChildElementTypes(elementType.getOwnerDocument(),
elementType.getAttribute(SchemaNodeFactory.NAME_ATTRIBUTE));
for(Iterator iter = childElementTypes.iterator(); iter.hasNext();) {
Element childElementType = (Element)iter.next();
addOptionalTags(map, childElementType);
@@ -169,10 +171,10 @@
// KbPlugin.log(" map size=" + map.size());
}
- private static ArrayList<Element> getChildElementTypes(Document schema, String
tagName) {
- ArrayList<Element> childElementTypes = new ArrayList<Element>();
+ private static List<Element> getChildElementTypes(Document schema, String tagName)
{
+ List<Element> childElementTypes = new ArrayList<Element>();
- ArrayList childElements = getChildElements(schema, tagName);
+ List childElements = getChildElements(schema, tagName);
for(Iterator iter = childElements.iterator(); iter.hasNext();) {
Element element = (Element)iter.next();