Author: scabanovich
Date: 2007-08-16 12:49:42 -0400 (Thu, 16 Aug 2007)
New Revision: 3177
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java
Log:
Reducing meta - removed empty elements <Editor/> and <Constraint/>
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java 2007-08-16
14:15:27 UTC (rev 3176)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/XAttributeImpl.java 2007-08-16
16:49:42 UTC (rev 3177)
@@ -129,7 +129,13 @@
}
public void load(Element el){
- setEditor((XAttributeEditor)XMetaDataLoader.loadMetaElement(el, EDITOR,
XAttributeEditorImpl.class, false));
+ if(XMLUtil.getUniqueChild(el, EDITOR) == null) {
+ XAttributeEditorImpl editor = new XAttributeEditorImpl();
+ editor.setName(null);
+ setEditor(editor);
+ } else {
+ setEditor((XAttributeEditor)XMetaDataLoader.loadMetaElement(el, EDITOR,
XAttributeEditorImpl.class, false));
+ }
Element c = XMetaDataLoader.getUniqueChild(el, CONSTRAINT);
if (c != null) loadConstraint(c);
setVisible(XMetaDataLoader.getBoolean(el, VISIBLE, true));
@@ -284,7 +290,7 @@
Element element = this.element;
if(this.constraint != null) return;
XAttributeConstraint constraint = null;
- try {
+ if(loader != null) try {
String clsname = loader.indexOf('.') >= 0 ? loader :
XAttributeImpl.CONSTRAINT_PREFIX + loader;
if(loader.length() > 0) {
constraint =
(XAttributeConstraint)ModelFeatureFactory.getInstance().createFeatureInstance(clsname);
@@ -293,7 +299,7 @@
ModelPlugin.getPluginLog().logError("XAttributeImpl:loadConstraint:" +
e.getMessage());
}
if(constraint == null) constraint = new XAttributeConstraintImpl();
- try {
+ if(element != null) try {
((XAttributeConstraintImpl)constraint).load(element);
} catch (Exception t) {
ModelPlugin.getPluginLog().logError("XAttributeImpl:loadConstraint:" +
t.getMessage());
Show replies by date