Example #1
0
 @Override
 protected void populateFromCDataElement(AttributeDataType dataType, String tag, String text)
     throws XMLStreamException {
   super.populateFromCDataElement(dataType, tag, text);
   if (DEFAULT_VALUE.equals(tag)) {
     dataType.setDefaultValue(text);
   }
   if (ENUM_TYPE_ID.equals(tag)) {
     dataType.setEnumTypeId(Integer.parseInt(text));
   }
 }
Example #2
0
 @Override
 protected void populateFromAttributes(
     AttributeDataType dataType, String tag, Map<String, String> attributes)
     throws XMLStreamException {
   super.populateFromAttributes(dataType, tag, attributes);
   if (MULTIPLICITY.equals(tag)) {
     String value = attributes.get(MIN_OCCURRENCE);
     if (value != null) {
       dataType.setMinOccurrence(Integer.parseInt(value));
     }
     value = attributes.get(MAX_OCCURRENCE);
     if (value != null) {
       dataType.setMaxOccurrence(Integer.parseInt(value));
     }
   }
 }
Example #3
0
 @Override
 protected void writeBody(XMLStreamWriter writer, AttributeDataType dataType)
     throws XMLStreamException {
   writer.writeStartElement(MULTIPLICITY);
   writer.writeAttribute(MIN_OCCURRENCE, String.valueOf(dataType.getMinOccurrence()));
   writer.writeAttribute(MAX_OCCURRENCE, String.valueOf(dataType.getMaxOccurrence()));
   writer.writeEndElement();
   writeTextElement(writer, ATTRIBUTE_BASE, dataType.getBaseAttributeClass());
   writeTextElement(writer, ATTRIBUTE_PROVIDER, dataType.getProviderAttributeClass());
   writeTextElement(writer, TAGGER, dataType.getTaggerId());
   writeTextElement(writer, EXTENSION, dataType.getFileTypeExtension());
   writeCDataElement(writer, DEFAULT_VALUE, dataType.getDefaultValue());
   writeCDataElement(writer, ENUM_TYPE_ID, String.valueOf(dataType.getEnumTypeId()));
   writeTextElement(writer, TOOL_TIP, dataType.getToolTipText());
 }
Example #4
0
 @Override
 protected void populateFromTextElement(AttributeDataType dataType, String tag, String text)
     throws XMLStreamException {
   super.populateFromTextElement(dataType, tag, text);
   if (ATTRIBUTE_BASE.equals(tag)) {
     dataType.setBaseAttributeClass(text);
   }
   if (ATTRIBUTE_PROVIDER.equals(tag)) {
     dataType.setProviderAttributeClass(text);
   }
   if (TAGGER.equals(tag)) {
     dataType.setTaggerId(text);
   }
   if (EXTENSION.equals(tag)) {
     dataType.setFileTypeExtension(text);
   }
   if (TOOL_TIP.equals(tag)) {
     dataType.setToolTipText(text);
   }
 }