Por favor, lembre-se que esta tradução da especificação é resultado de um projeto da comunidade java.net( https://jdk5-api-pt-br.dev.java.net/). A versão oficial da especificação é a versão na língua inglesa que pode ser encontrada em http://java.sun.com/j2se/1.5.0/docs/api/. Em caso de divergências, a versão predominante da especificação é a original em inglês.

Please note that this translation of the specification is the result of a java.net community project ( https://jdk5-api-pt-br.dev.java.net/ ). The official version of the specification is the US English language version which can be found at http://java.sun.com/j2se/1.5.0/docs/api/. In case of disputes, the authoritative version of the specification is the original, English document.


JavaTM 2 Platform
Standard Ed. 5.0

java.lang
Class IllegalStateException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.lang.IllegalStateException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AlreadyConnectedException, CancellationException, CancelledKeyException, ClosedSelectorException, ConnectionPendingException, FormatterClosedException, IllegalBlockingModeException, IllegalComponentStateException, InvalidDnDOperationException, InvalidMarkException, NoConnectionPendingException, NonReadableChannelException, NonWritableChannelException, NotYetBoundException, NotYetConnectedException, OverlappingFileLockException

public class IllegalStateException
extends RuntimeException

Sinaliza que um método foi invocado em momento ilegal ou inapropriado. Em outras palavras, o ambiente Java ou a aplicação Java não está em um estado apropriado para a operação requerida.

Since:
JDK1.1
See Also:
Serialized Form

Constructor Summary
IllegalStateException()
          Constrói um IllegalStateException sem mensagem de detalhe.
IllegalStateException(String s)
          Constrói um IllegalStateException com a mensagem de detalhe especificada.
IllegalStateException(String message, Throwable cause)
          Constrói uma nova exceção com a mensagem de detalhe e a causa especificadas.
IllegalStateException(Throwable cause)
          Constrói uma nova exceção com a causa especificada e uma mensagem de detalhe (cause==null ? null : cause.toString()) (o que tipicamente contém a classe e a mensagem de detalhe de cause).
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IllegalStateException

public IllegalStateException()
Constrói um IllegalStateException sem mensagem de detalhe. Uma mensagem de detalhe é uma String que descreve essa exceção em particular.


IllegalStateException

public IllegalStateException(String s)
Constrói um IllegalStateException com a mensagem de detalhe especificada. Uma mensagem de detalhe é uma String que descreve essa exceção em particular.

Parameters:
s - a String que contém a mensagem de detalhe

IllegalStateException

public IllegalStateException(String message,
                             Throwable cause)
Constrói uma nova exceção com a mensagem de detalhe e a causa especificadas.

Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - a mensagem de detalhe (que é salva para recuperação posterior pelo método Throwable.getMessage()).
cause - a causa (que é salva para recuperação posterior pelo método Throwable.getCause()). (Um valor null é permitido, e indica que a causa é inexistente ou desconhecida.)
Since:
1.5

IllegalStateException

public IllegalStateException(Throwable cause)
Constrói uma nova exceção com a causa especificada e uma mensagem de detalhe (cause==null ? null : cause.toString()) (o que tipicamente contém a classe e a mensagem de detalhe de cause). Esse construtor é útil para exceções que são pouco mais que This constructor is useful for exceptions that are little more than wrappers para outros objetos lançáveis (por exemplo, PrivilegedActionException).

Parameters:
cause - a causa (que é salva para recuperação posterior pelo método Throwable.getCause()). (Um valor null é permitido, e indica que a causa é inexistente ou desconhecida.)
Since:
1.5

JavaTM 2 Platform
Standard Ed. 5.0

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Copyright 2006 Sun Microsystems, Inc. Todos os direitos reservados. O uso está sujeito aos termos da licensa.