You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CreationHelper.java 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.ss.usermodel;
  16. import org.apache.poi.common.usermodel.HyperlinkType;
  17. import org.apache.poi.util.Removal;
  18. /**
  19. * An object that handles instantiating concrete
  20. * classes of the various instances one needs for
  21. * HSSF and XSSF.
  22. * Works around a limitation in Java where we
  23. * cannot have static methods on interfaces or abstract
  24. * classes.
  25. * This allows you to get the appropriate class for
  26. * a given interface, without you having to worry
  27. * about if you're dealing with HSSF or XSSF.
  28. */
  29. public interface CreationHelper {
  30. /**
  31. * Creates a new RichTextString instance
  32. * @param text The text to initialise the RichTextString with
  33. */
  34. RichTextString createRichTextString(String text);
  35. /**
  36. * Creates a new DataFormat instance
  37. */
  38. DataFormat createDataFormat();
  39. /**
  40. * Creates a new Hyperlink, of the given type
  41. * @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead.
  42. */
  43. @Removal(version="3.17")
  44. @Deprecated
  45. Hyperlink createHyperlink(int type);
  46. /**
  47. * Creates a new Hyperlink, of the given type
  48. */
  49. Hyperlink createHyperlink(HyperlinkType type);
  50. /**
  51. * Creates FormulaEvaluator - an object that evaluates formula cells.
  52. *
  53. * @return a FormulaEvaluator instance
  54. */
  55. FormulaEvaluator createFormulaEvaluator();
  56. /**
  57. * Creates a XSSF-style Color object, used for extended sheet
  58. * formattings and conditional formattings
  59. */
  60. ExtendedColor createExtendedColor();
  61. /**
  62. * Creates a ClientAnchor. Use this object to position drawing object in a sheet
  63. *
  64. * @return a ClientAnchor instance
  65. * @see org.apache.poi.ss.usermodel.Drawing
  66. */
  67. ClientAnchor createClientAnchor();
  68. }