com.android.ide.common.res2
Class MergingException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.android.ide.common.res2.MergingException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DuplicateDataException, MergeConsumer.ConsumerException

public class MergingException
extends java.lang.Exception

Exception for errors during merging.

See Also:
Serialized Form

Nested Class Summary
static class MergingException.Builder
           
 
Field Summary
static java.lang.String MULTIPLE_ERRORS
           
static java.lang.String RESOURCE_ASSET_MERGER_TOOL_NAME
           
 
Constructor Summary
protected MergingException(java.lang.Throwable cause, com.android.ide.common.blame.Message... messages)
          For internal use.
 
Method Summary
 java.lang.String getMessage()
          Computes the error message to display for this error
 java.util.List<com.android.ide.common.blame.Message> getMessages()
           
static void throwIfNonEmpty(java.util.Collection<com.android.ide.common.blame.Message> messages)
           
 java.lang.String toString()
           
static MergingException.Builder withMessage(java.lang.String message, java.lang.Object... args)
           
static MergingException.Builder wrapException(java.lang.Throwable cause)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MULTIPLE_ERRORS

public static final java.lang.String MULTIPLE_ERRORS
See Also:
Constant Field Values

RESOURCE_ASSET_MERGER_TOOL_NAME

public static final java.lang.String RESOURCE_ASSET_MERGER_TOOL_NAME
See Also:
Constant Field Values
Constructor Detail

MergingException

protected MergingException(@Nullable
                           java.lang.Throwable cause,
                           @NonNull
                           com.android.ide.common.blame.Message... messages)
For internal use. Creates a new MergingException

Parameters:
cause - the original exception. May be null.
messages - the messaged. Must contain at least one item.
Method Detail

wrapException

public static MergingException.Builder wrapException(@NonNull
                                                     java.lang.Throwable cause)

withMessage

public static MergingException.Builder withMessage(@NonNull
                                                   java.lang.String message,
                                                   java.lang.Object... args)

throwIfNonEmpty

public static void throwIfNonEmpty(java.util.Collection<com.android.ide.common.blame.Message> messages)
                            throws MergingException
Throws:
MergingException

getMessages

@NonNull
public java.util.List<com.android.ide.common.blame.Message> getMessages()

getMessage

@NonNull
public java.lang.String getMessage()
Computes the error message to display for this error

Overrides:
getMessage in class java.lang.Throwable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable