コード例 #1
0
    public void init(String name, Attributes atts) {

      logger.log(LogService.LOG_DEBUG, "Here is IconHandler:init()"); // $NON-NLS-1$
      super.init(name, atts);
      String icon_resource_val = atts.getValue(RESOURCE);
      if (icon_resource_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  RESOURCE,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      String icon_size_val = atts.getValue(SIZE);
      if (icon_size_val == null) {
        // Not a problem, because SIZE is an optional attribute.
        icon_size_val = "0"; // $NON-NLS-1$
      } else if (icon_size_val.equalsIgnoreCase("")) { // $NON-NLS-1$
        icon_size_val = "0"; // $NON-NLS-1$
      }

      _icon = new Icon(icon_resource_val, Integer.parseInt(icon_size_val), _dp_bundle);
    }
コード例 #2
0
    public void init(String name, Attributes attributes) {

      logger.log(LogService.LOG_DEBUG, "Here is MetaDataHandler():init()"); // $NON-NLS-1$
      super.init(name, attributes);
      _dp_localization = attributes.getValue(LOCALIZATION);
      if (_dp_localization == null) {
        // Not a problem, because LOCALIZATION is an optional attribute.
      }
      // The global variable "_dp_localization" will be used within
      // OcdHandler and AttributeDefinitionHandler later.
    }
コード例 #3
0
    public void init(
        String name, Attributes atts, Hashtable<String, ObjectClassDefinitionImpl> ocds_hashtable) {

      logger.log(LogService.LOG_DEBUG, "Here is OcdHandler():init()"); // $NON-NLS-1$
      super.init(name, atts);
      _parent_OCDs_hashtable = ocds_hashtable;
      collectExtensionAttributes(atts);
      String ocd_name_val = atts.getValue(NAME);
      if (ocd_name_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  NAME,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      String ocd_description_val = atts.getValue(DESCRIPTION);
      if (ocd_description_val == null) {
        // Not a problem, because DESCRIPTION is an optional attribute.
      }

      _refID = atts.getValue(ID);
      if (_refID == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  ID,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      _ocd =
          new ObjectClassDefinitionImpl(
              ocd_name_val, ocd_description_val, _refID, _dp_localization, extensionAttributes);
    }
コード例 #4
0
    public void init(String name, Attributes atts) {
      logger.log(LogService.LOG_DEBUG, "Here is DesignateHandler():init()"); // $NON-NLS-1$
      super.init(name, atts);
      _pid_val = atts.getValue(PID);
      _factory_val = atts.getValue(FACTORY);
      if (_pid_val == null && _factory_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_DESIGNATE_PID_AND_FACTORYPID,
                new Object[] {
                  elementId, _dp_url, _dp_bundle.getBundleId(), _dp_bundle.getSymbolicName()
                }));
        return;
      }

      _bundle_val = atts.getValue(BUNDLE);
      if (_bundle_val == null) {
        // Not a problem because BUNDLE is an optional attribute.
      }

      String optional_str = atts.getValue(OPTIONAL);
      if (optional_str == null) {
        // Not a problem, because OPTIONAL is an optional attribute.
        // The default value is "false".
        _optional_val = false;
      } else {
        _optional_val = Boolean.valueOf(optional_str).booleanValue();
      }

      String merge_str = atts.getValue(MERGE);
      if (merge_str == null) {
        // Not a problem, because MERGE is an optional attribute.
        // The default value is "false".
        _merge_val = false;
      } else {
        _merge_val = Boolean.valueOf(merge_str).booleanValue();
      }
    }
コード例 #5
0
    public void init(String name, Attributes atts) {

      logger.log(LogService.LOG_DEBUG, "Here is OptionHandler:init()"); // $NON-NLS-1$
      super.init(name, atts);
      _label_val = atts.getValue(LABEL);
      if (_label_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  LABEL,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      _value_val = atts.getValue(VALUE);
      if (_value_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  VALUE,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }
    }
コード例 #6
0
    public void init(String name, Attributes atts) {

      logger.log(LogService.LOG_DEBUG, "Here is AttributeHandler():init()"); // $NON-NLS-1$
      super.init(name, atts);
      _adref_val = atts.getValue(ADREF);
      if (_adref_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  ADREF,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      _content_val = atts.getValue(CONTENT);
      if (_content_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  CONTENT,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }
    }
コード例 #7
0
    public void init(String name, Attributes atts, Vector<AttributeDefinitionImpl> ad_vector) {

      logger.log(
          LogService.LOG_DEBUG, "Here is AttributeDefinitionHandler():init()"); // $NON-NLS-1$
      super.init(name, atts);
      _parent_ADs_vector = ad_vector;
      collectExtensionAttributes(atts);
      String ad_name_val = atts.getValue(NAME);
      if (ad_name_val == null) {
        // Not a problem, because NAME is an optional attribute.
      }

      String ad_description_val = atts.getValue(DESCRIPTION);
      if (ad_description_val == null) {
        // Not a problem, because DESCRIPTION is an optional attribute.
      }

      String ad_id_val = atts.getValue(ID);
      if (ad_id_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  ID,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      String ad_type_val = atts.getValue(TYPE);
      if (ad_type_val == null) {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.MISSING_ATTRIBUTE,
                new Object[] {
                  TYPE,
                  name,
                  atts.getValue(ID),
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }
      if (ad_type_val.equalsIgnoreCase(STRING)) {
        _dataType = AttributeDefinition.STRING;
      } else if (ad_type_val.equalsIgnoreCase(LONG)) {
        _dataType = AttributeDefinition.LONG;
      } else if (ad_type_val.equalsIgnoreCase(DOUBLE)) {
        _dataType = AttributeDefinition.DOUBLE;
      } else if (ad_type_val.equalsIgnoreCase(FLOAT)) {
        _dataType = AttributeDefinition.FLOAT;
      } else if (ad_type_val.equalsIgnoreCase(INTEGER)) {
        _dataType = AttributeDefinition.INTEGER;
      } else if (ad_type_val.equalsIgnoreCase(BYTE)) {
        _dataType = AttributeDefinition.BYTE;
      } else if (ad_type_val.equalsIgnoreCase(CHAR)) {
        _dataType = AttributeDefinition.CHARACTER;
      } else if (ad_type_val.equalsIgnoreCase(BOOLEAN)) {
        _dataType = AttributeDefinition.BOOLEAN;
      } else if (ad_type_val.equalsIgnoreCase(SHORT)) {
        _dataType = AttributeDefinition.SHORT;
      } else if (ad_type_val.equalsIgnoreCase(PASSWORD)) {
        _dataType = AttributeDefinition.PASSWORD;
      } else {
        _isParsedDataValid = false;
        logger.log(
            LogService.LOG_ERROR,
            NLS.bind(
                MetaTypeMsg.INVALID_TYPE,
                new Object[] {
                  ad_type_val,
                  ad_id_val,
                  _dp_url,
                  _dp_bundle.getBundleId(),
                  _dp_bundle.getSymbolicName()
                }));
        return;
      }

      String ad_cardinality_str = atts.getValue(CARDINALITY);
      int ad_cardinality_val = 0;
      if (ad_cardinality_str == null) {
        // Not a problem, because CARDINALITY is an optional attribute.
        // And the default value is 0.
      } else {
        ad_cardinality_val = Integer.parseInt(ad_cardinality_str);
      }

      String ad_min_val = atts.getValue(MIN);
      if (ad_min_val == null) {
        // Not a problem, because MIN is an optional attribute.
      }

      String ad_max_val = atts.getValue(MAX);
      if (ad_max_val == null) {
        // Not a problem, because MAX is an optional attribute.
      }

      ad_defaults_str = atts.getValue(DEFAULT);
      if (ad_defaults_str == null) {
        // Not a problem, because DEFAULT is an optional attribute.
      }

      String ad_required_val = atts.getValue(REQUIRED);
      if (ad_required_val == null) {
        // Not a problem, because REQUIRED is an optional attribute.
        // And the default value is 'true'.
        ad_required_val = Boolean.TRUE.toString();
      }

      _ad =
          new AttributeDefinitionImpl(
              ad_id_val,
              ad_name_val,
              ad_description_val,
              _dataType,
              ad_cardinality_val,
              convert(ad_min_val, _dataType),
              convert(ad_max_val, _dataType),
              Boolean.valueOf(ad_required_val).booleanValue(),
              _dp_localization,
              logger,
              extensionAttributes);
    }