|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.tools.generator.util.AbstractCommandLineApp
public class AbstractCommandLineApp
Assorted utility methods that are shared by the command line apps (wsdl2java and wsdlmerge). Logging is handled here for the org.apache.muse.tools.generator package using java.util.logging classes.
Field Summary | |
---|---|
protected static Logger |
_logger
|
static String |
PATH_TO_POM_PROPERTIES
|
static String |
TOP_LEVEL_PACKAGE
|
static String |
VERSION_PROPERTY
|
Constructor Summary | |
---|---|
AbstractCommandLineApp()
|
Method Summary | |
---|---|
protected static boolean |
checkOverwriteArg(CommandLine arguments)
Check to see if the overwrite flag was specified. |
static void |
checkParentDirectory(File destination)
Check to make sure that the parent directory of a given file exists or can be created. |
protected static void |
createLogger(CommandLine arguments)
Set up the java.util.Logger that this class (and the descendants in the Logger heirarchy) will use. |
static Object[] |
getFiller(Exception e)
Check an exception to see if it has a message and if it has one then make it into the standard Messages filler object and return it. |
static MetadataDescriptor |
getMetadataDescriptor(String wsdlPath,
Environment env,
Document wsdlDocument)
Given a WSDL document, extract the metadata descriptor (if any) and return it. |
static MetadataDescriptor |
getMetadataDescriptor(String wsdlPath,
WsdlEnvironment env)
Convenience method that will get the document from the environment. |
static MetadataDescriptor[] |
getMetadataDescriptors(File descriptorFile,
Document descriptorDocument)
|
static String |
getVersion()
Get the version out of maven metadata that's left from the build. |
static Document |
getWSDLDocument(String wsdlPath,
Environment env)
Given a File try to load it into a Definition
throwing an Exception if something is amiss. |
static Document[] |
getWSDLDocuments(File deploymentDescriptorFile,
Document deploymentDescriptorDocument)
Tries to parse the WSDL Document from the given file. |
static void |
handleErrorAndExit(String message)
Something bad happened, log the message and exit with status 1. |
static void |
handleErrorAndExit(String message,
Exception exception)
Something bad happened, log the message and associated exception. |
static void |
handleExit()
For cleanliness wrap System.exit(0) exiting normally. |
static void |
handleMessage(String message)
Tell the logger to info() this message. |
static boolean |
hasNoArguments(CommandLine arguments)
Check to see if the given arguments object has no arguments in it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TOP_LEVEL_PACKAGE
public static final String PATH_TO_POM_PROPERTIES
public static final String VERSION_PROPERTY
protected static Logger _logger
Constructor Detail |
---|
public AbstractCommandLineApp()
Method Detail |
---|
public static void handleMessage(String message)
message
- The message to log.public static void handleErrorAndExit(String message)
message
- The error messagepublic static void handleErrorAndExit(String message, Exception exception)
message
- exception
- public static void handleExit()
public static Object[] getFiller(Exception e)
e
- The exception we're interest in
Messages
public static Document[] getWSDLDocuments(File deploymentDescriptorFile, Document deploymentDescriptorDocument) throws Exception
deploymentDescriptorFile
- deploymentDescriptorDocument
-
Exception
public static MetadataDescriptor[] getMetadataDescriptors(File descriptorFile, Document descriptorDocument) throws Exception
Exception
public static MetadataDescriptor getMetadataDescriptor(String wsdlPath, WsdlEnvironment env)
wsdlPath
- env
- public static MetadataDescriptor getMetadataDescriptor(String wsdlPath, Environment env, Document wsdlDocument)
wsdlPath
- env
- wsdlDocument
-
public static Document getWSDLDocument(String wsdlPath, Environment env) throws Exception
File
try to load it into a Definition
throwing an Exception if something is amiss. The wsdl document is inlined in
that all referenced schema and wsdl documents are copied into this document. The
references to the locations of the imported/include documents are stripped.
wsdlPath
- The WSDL file we're parsing
Definition
of the parsed WSDL
Exception
public static boolean hasNoArguments(CommandLine arguments)
arguments
- The arguments we're checking
protected static void createLogger(CommandLine arguments)
arguments
- Command line argumentsprotected static boolean checkOverwriteArg(CommandLine arguments)
arguments
- Command line arguments
public static String getVersion()
public static void checkParentDirectory(File destination) throws Exception
destination
- Target file to check
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |