0 Replies Latest reply on Apr 18, 2007 6:10 PM by ToBeNamedLater

    java CreateObject with static constructor

    ToBeNamedLater
      I'm using the Smack API library From Javasoft in a ColdFusion app. So far so good.

      But now I want to change the presence indicator. The problem is that the Presence constructor takes a typesafe enum class as a parameter. I can't figure out how to get at it.

      The constructor from the Smack API:

      Constructor Summary
      Presence(Presence.Type type)
      Creates a new presence update.

      Nested Class Summary
      static class Presence.Type
      A typsafe enum class to represent the presence type.

      As documented
      here

      The working code is pretty straightforward (Code block 1).

      but now I need to add the presence stuff.
      Code Block 2 fails generally
      Code Block 3 errors with "Object Instantiation Exception".

      How do I access a static nested class in order to call the constructor?

      Presence
      Enum Presence.Type