Common Utility Classes

We have a common util module in the core git repository now!

 

Please familiarize yourself with these classes to save yourself work, and to make sure we don't "reinvent the wheel":

 

org.switchyard.common.io.CountingOutputStream
org.switchyard.common.io.pull.ElementPuller
org.switchyard.common.io.pull.PropertiesPuller
org.switchyard.common.io.pull.Puller
org.switchyard.common.io.pull.StringPuller
org.switchyard.common.io.resource.BaseResource
org.switchyard.common.io.resource.Resource
org.switchyard.common.io.resource.ResourceType
org.switchyard.common.io.resource.SimpleResource
org.switchyard.common.lang.Strings
org.switchyard.common.type.Classes
org.switchyard.common.type.classpath.AbstractTypeFilter
org.switchyard.common.type.classpath.ClasspathScanner
org.switchyard.common.type.classpath.Filter
org.switchyard.common.type.classpath.InstanceOfFilter
org.switchyard.common.type.classpath.IsAnnotationPresentFilter
org.switchyard.common.type.classpath.ResourceExistsFilter
org.switchyard.common.type.CompoundClassLoader
org.switchyard.common.type.reflect.Access
org.switchyard.common.type.reflect.BeanAccess
org.switchyard.common.type.reflect.Construction
org.switchyard.common.type.reflect.FieldAccess
org.switchyard.common.type.reflect.MethodAccess
org.switchyard.common.xml.Element
org.switchyard.common.xml.IdentitySAXHandler
org.switchyard.common.xml.Node
org.switchyard.common.xml.QNameUtil
org.switchyard.common.xml.Text
org.switchyard.common.xml.XMLHelper

 

In particular, please note the "Classes" class.  Please use this instead of Class.forName  / getResource / getResources / getResourceAsStream or ClassLoader.getResource / getResources / getResourceAsStream.  It will make sure you find what you're looking for correctly.

 

Two important rules:

  1. Don't put anything in the common module if it has any dependencies outside of the common module itself.
  2. Don't use the common module in user-facing code (like in the api or quickstarts modules). Everywhere else if fair game.