1. /*
  2. * Copyright 2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.betwixt.io.read;
  17. import org.apache.commons.betwixt.expression.Updater;
  18. import org.xml.sax.Attributes;
  19. /**
  20. * Action binds a simple type.
  21. * @author <a href="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
  22. * @version $Revision: 1.2 $
  23. */
  24. public class SimpleTypeBindAction extends MappingAction.Base {
  25. public static final SimpleTypeBindAction INSTANCE = new SimpleTypeBindAction();
  26. public void body(String text, ReadContext context) throws Exception {
  27. // add dyna-bean support!
  28. // probably refactoring needed
  29. Updater updater = context.getCurrentUpdater();
  30. if (updater != null)
  31. {
  32. updater.update(context, text);
  33. } else {
  34. if (context.getLog().isDebugEnabled())
  35. {
  36. context.getLog().debug("No updater for simple type '" + context.getCurrentElement() + "'");
  37. }
  38. }
  39. }
  40. public MappingAction next(
  41. String namespace,
  42. String name,
  43. Attributes attributes,
  44. ReadContext context)
  45. throws Exception {
  46. return MappingAction.IGNORE;
  47. }
  48. }