티스토리 뷰

오늘 삽질하다가... 발견한 Sun의 Java6의 javax.xml.stream.?XMLOutputFactory 소스의 일부... -.-;;;;;

  1. public abstract class XMLOutputFactory {
  2. ...
  3. /**
  4. * Create a new instance of the factory using the default factory location
  5. * mechanism (check env. variable, jaxp.properties, jar services manifest,
  6. * in this order)
  7. *
  8. * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
  9. */
  10. public static XMLOutputFactory newInstance() throws FactoryConfigurationError {
  11.     return (XMLOutputFactory) FactoryFinder.find("javax.xml.stream.XMLOutputFactory",
  12. "com.sun.xml.internal.stream.XMLOutputFactoryImpl");
  13. }
  14.  
  15. /**
  16. * Create a new instance of the factory
  17. *
  18. * @param factoryId Name of the factory to find; not the class name but the
  19. *    property name to use
  20. * @param classLoader classLoader to use
  21. * @return the factory implementation
  22. * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
  23. */
  24. public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader)
  25. throws FactoryConfigurationError {
  26.     return (XMLInputFactory) FactoryFinder.find(factoryId, "com.sun.xml.stream.XMLOutputFactoryImpl", classLoader);
  27. }
  28. ...

뭐가 이상하냐고?

첫번째 함수와 두번째 함수의 리턴타입...

?XMLOutputFactory가 왜! ?XMLInputFactory를 create하는 것이냐!(버럭!!)

해결책: 그냥 [http]우드스탁을 쓰던가... [http]BEA의 StAX 참조구현을 쓰면 된다.

'hacking > java' 카테고리의 다른 글

Maven2와 Eclipse/WTP 함께쓰기  (0) 2007.09.11
singleton과 lazy loading...  (0) 2007.01.28
XML Exodus...  (3) 2007.01.07
아니~ 버~ㄹ써! Java6~  (0) 2006.12.12
Java, finally GPLed  (0) 2006.11.14
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함